From 71b7121dedfc5abd9110d5d093a3ba0acd605076 Mon Sep 17 00:00:00 2001 From: Damian Schneider Date: Sun, 28 Sep 2025 17:06:31 +0200 Subject: [PATCH] bugfix: do not reset segments if unchanged #4969 lines were swapped, causing segment reset on every preset call. --- wled00/FX_fcn.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/wled00/FX_fcn.cpp b/wled00/FX_fcn.cpp index 5847309e..50c9ffc7 100644 --- a/wled00/FX_fcn.cpp +++ b/wled00/FX_fcn.cpp @@ -537,7 +537,7 @@ void Segment::setUp(uint16_t i1, uint16_t i2, uint8_t grp, uint8_t spc, uint16_t stateChanged = true; // send UDP/WS broadcast - if (stop>start) markForBlank(); //turn old segment range off // WLEDMM stop > start + if (stop>start) markForBlank(); //turn old segment range off // WLEDMM stop > start // toDo: check if this can be skipped when boundsUnchanged if (i2 <= i1) { //disable segment stop = 0; markForReset(); @@ -558,8 +558,11 @@ void Segment::setUp(uint16_t i1, uint16_t i2, uint8_t grp, uint8_t spc, uint16_t spacing = spc; } if (ofs < UINT16_MAX) offset = ofs; - markForReset(); - if (!boundsUnchanged) refreshLightCapabilities(); + + if (!boundsUnchanged) { + markForReset(); + refreshLightCapabilities(); + } }