Skip to content

Commit 102d098

Browse files
committed
bugfix #3 for ghostly appearing switched-off segments
1 parent 859e56a commit 102d098

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

wled00/FX_fcn.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ bool Segment::setColor(uint8_t slot, uint32_t c) { //returns true if changed
551551
if (slot == 0 && c == BLACK) return false; // on/off segment cannot have primary color black
552552
if (slot == 1 && c != BLACK) return false; // on/off segment cannot have secondary color non black
553553
}
554-
if (fadeTransition) startTransition(strip.getTransition()); // start transition prior to change
554+
if (fadeTransition && on) startTransition(strip.getTransition()); // start transition prior to change // WLEDMM only on real change
555555
colors[slot] = c;
556556
stateChanged = true; // send UDP/WS broadcast
557557
return true;
@@ -564,7 +564,7 @@ void Segment::setCCT(uint16_t k) {
564564
k = (k - 1900) >> 5;
565565
}
566566
if (cct == k) return;
567-
if (fadeTransition) startTransition(strip.getTransition()); // start transition prior to change
567+
if (fadeTransition && on) startTransition(strip.getTransition()); // start transition prior to change
568568
cct = k;
569569
stateChanged = true; // send UDP/WS broadcast
570570
}
@@ -628,7 +628,7 @@ void Segment::setPalette(uint8_t pal) {
628628
if (pal < 245 && pal > GRADIENT_PALETTE_COUNT+13) pal = 0; // built in palettes
629629
if (pal > 245 && (strip.customPalettes.size() == 0 || 255U-pal > strip.customPalettes.size()-1)) pal = 0; // custom palettes
630630
if (pal != palette) {
631-
if (strip.paletteFade) startTransition(strip.getTransition());
631+
if (strip.paletteFade && on) startTransition(strip.getTransition());
632632
palette = pal;
633633
stateChanged = true; // send UDP/WS broadcast
634634
}

0 commit comments

Comments
 (0)