Correction for "Percent with speed" (#642)

The speed slider defines the "size" of pixels that will be added or substracted each refresh. If this size is bigger than the last value and you quickly move the intensity slider to zero, then the effect shows 100% all the time until it will be changed.
This commit is contained in:
Def3nder 2020-01-29 23:10:02 +01:00 committed by GitHub
parent ac927d188b
commit e4d5551f16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3027,7 +3027,7 @@ uint16_t WS2812FX::mode_percent(void) {
SEGENV.step += size;
if (SEGENV.step > active_leds) SEGENV.step = active_leds;
} else if (active_leds < SEGENV.step) {
SEGENV.step -= size;
if (SEGENV.step > size) SEGENV.step -= size; else SEGENV.step = 0;
if (SEGENV.step < active_leds) SEGENV.step = active_leds;
}