From 4ed8ded502fa77396303a5241b643cb7fc406dce Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Mon, 30 Sep 2024 17:44:38 +0200 Subject: [PATCH] Akemi bugfix for panel width > 32 due to a math accident, Akemi did not show proper GEQ bands in its hands when width>32 --- wled00/FX.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wled00/FX.cpp b/wled00/FX.cpp index ad843f0f9..40db1a3df 100644 --- a/wled00/FX.cpp +++ b/wled00/FX.cpp @@ -7528,8 +7528,9 @@ uint16_t mode_2DAkemi(void) { //add geq left and right if (um_data && fftResult) { - for (int x=0; x < cols/8; x++) { - unsigned band = x * cols/8; + int xMax = cols/8; + for (int x=0; x < xMax; x++) { + unsigned band = map2(x, 0, max(xMax,4), 0, 15); // map 0..cols/8 to 16 GEQ bands band = constrain(band, 0, 15); int barHeight = map(fftResult[band], 0, 255, 0, 17*rows/32); CRGB color = CRGB(SEGMENT.color_from_palette((band * 35), false, PALETTE_SOLID_WRAP, 0));