From 79376bbc58e8e571eacd02bed8ac76aeec9a2200 Mon Sep 17 00:00:00 2001 From: Damian Schneider Date: Thu, 13 Nov 2025 18:26:00 +0100 Subject: [PATCH] improved lastCoordinate calculation --- wled00/image_loader.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wled00/image_loader.cpp b/wled00/image_loader.cpp index 05f0209a..34991210 100644 --- a/wled00/image_loader.cpp +++ b/wled00/image_loader.cpp @@ -85,8 +85,8 @@ 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; - if (outX + outY == lastCoordinate) return; // skip setting same coordinate again - lastCoordinate = outX + outY; // since input is a "scanline" this is sufficient to identify a "unique" coordinate + 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 for (int i = 0; i < perPixelX; i++) { for (int j = 0; j < perPixelY; j++) {