From 018ec283395be34a66e8d1a9b1ec56d857667701 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Thu, 15 May 2025 09:05:35 +0200 Subject: [PATCH] Merge consecutive same colors --- src/map/ENC/mapdata.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/map/ENC/mapdata.cpp b/src/map/ENC/mapdata.cpp index 09ba558b..98ce2b1e 100644 --- a/src/map/ENC/mapdata.cpp +++ b/src/map/ENC/mapdata.cpp @@ -339,8 +339,12 @@ static uint color(const QList &list) { uint c = 0; - for (int i = 0; i < list.size() && i < 4; i++) - c |= list.at(i).toUInt() << (i * 4); + for (int i = 0, j = 0; i < list.size() && j < 4; i++) { + if (!(i && list.at(i) == list.at(i-1))) { + c |= list.at(i).toUInt() << (j * 4); + j++; + } + } return c; }