BUGFIX in oscillate FX (#4494)

effect was changed from int to uint but it relied on negative numbers. fixed by checking overflow and a cast.
This commit is contained in:
Damian Schneider 2025-01-15 15:17:56 +01:00 committed by Will Tatam
parent edc6022441
commit 1bf13ea525

View File

@ -1809,7 +1809,7 @@ uint16_t mode_oscillate(void) {
uint32_t color = BLACK;
for (unsigned j = 0; j < numOscillators; j++) {
if((int)i >= (int)oscillators[j].pos - oscillators[j].size && i <= oscillators[j].pos + oscillators[j].size) {
color = (color == BLACK) ? SEGCOLOR(j) : color_blend(color, SEGCOLOR(j), 128);
color = (color == BLACK) ? SEGCOLOR(j) : color_blend(color, SEGCOLOR(j), uint8_t(128));
}
}
SEGMENT.setPixelColor(i, color);