Fix for realtime drawing on main segment

This commit is contained in:
Blaž Kristan
2024-10-07 20:19:07 +02:00
parent be64930ebb
commit 210191b251
2 changed files with 7 additions and 2 deletions

View File

@@ -687,10 +687,11 @@ void setRealtimePixel(uint16_t i, byte r, byte g, byte b, byte w)
b = gamma8(b);
w = gamma8(w);
}
uint32_t col = RGBW32(r,g,b,w);
if (useMainSegmentOnly) {
strip.getMainSegment().setPixelColor(pix, r, g, b, w); // this expects that strip.getMainSegment().beginDraw() has been called in handleNotification()
strip.getMainSegment().setPixelColor(pix, col); // this expects that strip.getMainSegment().beginDraw() has been called in handleNotification()
} else {
strip.setPixelColor(pix, r, g, b, w);
strip.setPixelColor(pix, col);
}
}
}