diff --git a/wled00/FX.cpp b/wled00/FX.cpp index 0b8f2968a..ff69e4394 100644 --- a/wled00/FX.cpp +++ b/wled00/FX.cpp @@ -5103,8 +5103,8 @@ uint16_t mode_2DLissajous(void) { // By: Andrew Tuline //float ylocn = float(cos8(now/4+i*2)) / 255.0f; uint_fast8_t xlocn = sin8(phase/2 + (i*SEGMENT.speed)/32); uint_fast8_t ylocn = cos8(phase/2 + i*2); - xlocn = (cols < 2) ? 1 : (map(2*xlocn, 0,511, 0,2*(cols-1)) +1) /2; // softhack007: "*2 +1" for proper rounding - ylocn = (rows < 2) ? 1 : (map(2*ylocn, 0,511, 0,2*(rows-1)) +1) /2; // "rows > 2" is needed to avoid div/0 in map() + xlocn = (cols < 2) ? 1 : (map(2*xlocn, 0,511, 0,2*(cols-1)) +1) /2; // softhack007: "(2* ..... +1) /2" for proper rounding + ylocn = (rows < 2) ? 1 : (map(2*ylocn, 0,511, 0,2*(rows-1)) +1) /2; // "rows > 1" is needed to avoid div/0 in map() SEGMENT.setPixelColorXY((uint8_t)xlocn, (uint8_t)ylocn, SEGMENT.color_from_palette(millis()/100+i, false, PALETTE_SOLID_WRAP, 0)); }