Missing isActive()
This commit is contained in:
parent
799d4f9465
commit
660a809ec8
@ -1136,7 +1136,7 @@ void WS2812FX::setColor(uint8_t slot, uint32_t c) {
|
|||||||
if (slot >= NUM_COLORS) return;
|
if (slot >= NUM_COLORS) return;
|
||||||
|
|
||||||
for (segment &seg : _segments) {
|
for (segment &seg : _segments) {
|
||||||
if (seg.isSelected()) {
|
if (seg.isActive() && seg.isSelected()) {
|
||||||
seg.setColor(slot, c);
|
seg.setColor(slot, c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1172,7 +1172,7 @@ uint8_t WS2812FX::getFirstSelectedSegId(void)
|
|||||||
{
|
{
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
for (segment &seg : _segments) {
|
for (segment &seg : _segments) {
|
||||||
if (seg.isSelected()) return i;
|
if (seg.isActive() && seg.isSelected()) return i;
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
// if none selected, use the main segment
|
// if none selected, use the main segment
|
||||||
|
Loading…
Reference in New Issue
Block a user