From e4d5551f168f09e59f14535a9507a2614ac3bf02 Mon Sep 17 00:00:00 2001 From: Def3nder <33399267+Def3nder@users.noreply.github.com> Date: Wed, 29 Jan 2020 23:10:02 +0100 Subject: [PATCH] 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. --- wled00/FX.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wled00/FX.cpp b/wled00/FX.cpp index 96880f4d8..796a52976 100644 --- a/wled00/FX.cpp +++ b/wled00/FX.cpp @@ -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; }