1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-06-02 16:23:03 +02:00

Merge consecutive same colors

This commit is contained in:
Martin Tůma 2025-05-15 09:05:35 +02:00
parent cebe4cde69
commit 018ec28339

View File

@ -339,8 +339,12 @@ static uint color(const QList<QByteArray> &list)
{ {
uint c = 0; uint c = 0;
for (int i = 0; i < list.size() && i < 4; i++) for (int i = 0, j = 0; i < list.size() && j < 4; i++) {
c |= list.at(i).toUInt() << (i * 4); if (!(i && list.at(i) == list.at(i-1))) {
c |= list.at(i).toUInt() << (j * 4);
j++;
}
}
return c; return c;
} }