bugfix #3 for ghostly appearing switched-off segments

This commit is contained in:
Frank
2024-12-04 18:05:37 +01:00
parent 859e56a2eb
commit 102d098e28

View File

@@ -551,7 +551,7 @@ bool Segment::setColor(uint8_t slot, uint32_t c) { //returns true if changed
if (slot == 0 && c == BLACK) return false; // on/off segment cannot have primary color black
if (slot == 1 && c != BLACK) return false; // on/off segment cannot have secondary color non black
}
if (fadeTransition) startTransition(strip.getTransition()); // start transition prior to change
if (fadeTransition && on) startTransition(strip.getTransition()); // start transition prior to change // WLEDMM only on real change
colors[slot] = c;
stateChanged = true; // send UDP/WS broadcast
return true;
@@ -564,7 +564,7 @@ void Segment::setCCT(uint16_t k) {
k = (k - 1900) >> 5;
}
if (cct == k) return;
if (fadeTransition) startTransition(strip.getTransition()); // start transition prior to change
if (fadeTransition && on) startTransition(strip.getTransition()); // start transition prior to change
cct = k;
stateChanged = true; // send UDP/WS broadcast
}
@@ -628,7 +628,7 @@ void Segment::setPalette(uint8_t pal) {
if (pal < 245 && pal > GRADIENT_PALETTE_COUNT+13) pal = 0; // built in palettes
if (pal > 245 && (strip.customPalettes.size() == 0 || 255U-pal > strip.customPalettes.size()-1)) pal = 0; // custom palettes
if (pal != palette) {
if (strip.paletteFade) startTransition(strip.getTransition());
if (strip.paletteFade && on) startTransition(strip.getTransition());
palette = pal;
stateChanged = true; // send UDP/WS broadcast
}