From 598e0bc06143bceac8dd705f8e855c68df3808ce Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Mon, 18 Sep 2023 15:34:53 +0200 Subject: [PATCH] matrix: fix for a corner case (e.g. gapmaps) workaround for a corner case; if the reference pixels falls into a "gap" then gPC returns BLACK. Solutions is to reject BLACK. --- wled00/FX.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/wled00/FX.cpp b/wled00/FX.cpp index 31ff74aa..7cea200e 100644 --- a/wled00/FX.cpp +++ b/wled00/FX.cpp @@ -5303,6 +5303,7 @@ uint16_t mode_2Dmatrix(void) { // Matrix2D. By Jeremy Williams. oldSpawnColor = SEGMENT.getPixelColorXY(SEGENV.aux0, SEGENV.aux1); // find color of previous spawns SEGENV.aux1 ++; // our sample pixel will be one row down the next time } + if ((oldSpawnColor == CRGB::Black) || (oldSpawnColor == trailColor)) oldSpawnColor = spawnColor; // reject "black", as it would mean that ALL pixels create trails // move pixels one row down. Falling codes keep color and add trail pixels; all others pixels are faded for (int row=rows-1; row>=0; row--) {