From fc776eeb1646daf002f5b6d37f27d21c858e8d61 Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Fri, 14 Nov 2025 01:08:48 +0100 Subject: [PATCH] add comment to explain coordinate packing logic --- wled00/image_loader.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/wled00/image_loader.cpp b/wled00/image_loader.cpp index 34991210..b201996e 100644 --- a/wled00/image_loader.cpp +++ b/wled00/image_loader.cpp @@ -85,6 +85,7 @@ void drawPixelCallback2D(int16_t x, int16_t y, uint8_t red, uint8_t green, uint8 // simple nearest-neighbor scaling int outY = (int)y * activeSeg->vHeight() / gifHeight; int outX = (int)x * activeSeg->vWidth() / gifWidth; + // Pack coordinates uniquely: outY into upper 16 bits, outX into lower 16 bits if (((outY << 16) | outX) == lastCoordinate) return; // skip setting same coordinate again lastCoordinate = (outY << 16) | outX; // since input is a "scanline" this is sufficient to identify a "unique" coordinate // set multiple pixels if upscaling