From 474e86306f3fcc51baa6f183181e61fe42b6c99e Mon Sep 17 00:00:00 2001 From: Blaz Kristan Date: Sat, 24 Dec 2022 22:00:35 +0100 Subject: [PATCH] Bugfix: incorrect maxWidth after switching from 2D --- wled00/FX_2Dfcn.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wled00/FX_2Dfcn.cpp b/wled00/FX_2Dfcn.cpp index 0ac09998..276c1dc3 100644 --- a/wled00/FX_2Dfcn.cpp +++ b/wled00/FX_2Dfcn.cpp @@ -41,6 +41,11 @@ void WS2812FX::setUpMatrix() { customMappingTable = nullptr; customMappingSize = 0; + // important if called from set.cpp, irrelevant if called from cfg.cpp + // fix limits if not a matrix set-up (no finalizeInit() called from set.cpp) + Segment::maxWidth = _length; + Segment::maxHeight = 1; + // isMatrix is set in cfg.cpp or set.cpp if (isMatrix) { uint16_t maxWidth = hPanels * panelW;