fix for off-by-one error in Lissajous (float version)

This commit is contained in:
Frank
2024-10-06 19:59:59 +02:00
parent d429293741
commit 4fadcade93
2 changed files with 3 additions and 3 deletions

View File

@@ -5654,7 +5654,7 @@ uint16_t mode_2DLissajous(void) { // By: Andrew Tuline
unsigned palIndex = (256*ylocn) + phase/2 + (i* SEGMENT.speed)/64;
//SEGMENT.setPixelColorXY(xlocn, ylocn, SEGMENT.color_from_palette(palIndex, false, PALETTE_SOLID_WRAP, 0)); // draw pixel with anti-aliasing - color follows rotation
// WLEDMM wu_pixel is 50% faster, and still lokks better
SEGMENT.wu_pixel(uint32_t(xlocn * (cols <<8)), uint32_t(ylocn * (rows <<8)),
SEGMENT.wu_pixel(uint32_t(xlocn * ((cols-1) <<8)), uint32_t(ylocn * ((rows-1) <<8)),
CRGB(SEGMENT.color_from_palette(palIndex, false, PALETTE_SOLID_WRAP, 0)));
}
} else

View File

@@ -466,8 +466,8 @@ void Segment::setPixelColorXY(float x, float y, uint32_t col, bool aa, bool fast
}
#else // replacement using wu_pixel
unsigned px = x * (virtualWidth() <<8);
unsigned py = y * (virtualHeight() <<8);
unsigned px = x * ((virtualWidth()-1) <<8);
unsigned py = y * ((virtualHeight()-1) <<8);
wu_pixel(px, py, CRGB(col));
#endif
}