Missing isActive()

This commit is contained in:
Blaž Kristan 2022-09-16 14:07:44 +02:00
parent 799d4f9465
commit 660a809ec8

View File

@ -1136,7 +1136,7 @@ void WS2812FX::setColor(uint8_t slot, uint32_t c) {
if (slot >= NUM_COLORS) return;
for (segment &seg : _segments) {
if (seg.isSelected()) {
if (seg.isActive() && seg.isSelected()) {
seg.setColor(slot, c);
}
}
@ -1172,7 +1172,7 @@ uint8_t WS2812FX::getFirstSelectedSegId(void)
{
size_t i = 0;
for (segment &seg : _segments) {
if (seg.isSelected()) return i;
if (seg.isActive() && seg.isSelected()) return i;
i++;
}
// if none selected, use the main segment