refactor resetSegments to work properly

add boundsOnly
This commit is contained in:
Ewoud
2023-02-13 15:54:18 +01:00
parent d215633578
commit 0d0f6b5e30
5 changed files with 30 additions and 20 deletions

View File

@@ -68,7 +68,7 @@ void WS2812FX::setUpMatrix(bool reset) {
Segment::maxHeight = 1;
panels = 0;
panel.clear(); // release memory allocated by panels
resetSegments();
resetSegments(true); //WLEDMM bounds only
return;
}
@@ -131,13 +131,7 @@ void WS2812FX::setUpMatrix(bool reset) {
Segment::maxWidth = _length;
Segment::maxHeight = 1;
}
if (reset) //resetSegments(); //WLEDMM: only if reset, and only update width and height, keep the fx in place
for (segment &seg : _segments) {
seg.start = 0;
seg.stop = Segment::maxWidth;
seg.startY = 0;
seg.stopY = Segment::maxHeight;
}
//WLEDMM: no resetSegments here, only do it in set.cpp/handleSettingsSet
}
#else
isMatrix = false; // no matter what config says