From d3d8fdff13452ea6a16db67db936e6e07f72d881 Mon Sep 17 00:00:00 2001 From: Blaz Kristan Date: Mon, 22 Aug 2022 22:02:36 +0200 Subject: [PATCH] Transpose fix. --- wled00/FX.cpp | 6 +- wled00/FX_fcn.cpp | 13 +- wled00/data/index.js | 8 +- wled00/html_ui.h | 3737 +++++++++++++++++++++--------------------- 4 files changed, 1888 insertions(+), 1876 deletions(-) diff --git a/wled00/FX.cpp b/wled00/FX.cpp index 2c01e1fe..2d3771f0 100644 --- a/wled00/FX.cpp +++ b/wled00/FX.cpp @@ -3574,7 +3574,8 @@ static const char _data_FX_MODE_PLASMA[] PROGMEM = "Plasma@Phase,;1,2,3;!;1d"; */ uint16_t mode_percent(void) { - uint8_t percent = MAX(0, MIN(200, SEGMENT.intensity)); + uint8_t percent = SEGMENT.intensity; + percent = constrain(percent, 0, 200); uint16_t active_leds = (percent < 100) ? SEGLEN * percent / 100.0 : SEGLEN * (200 - percent) / 100.0; @@ -4003,7 +4004,8 @@ static const char _data_FX_MODE_FLOW[] PROGMEM = "Flow@!,!;!,!,!;!;mp12=1,1d"; / */ uint16_t mode_chunchun(void) { - SEGMENT.fill(SEGCOLOR(1)); + //SEGMENT.fill(SEGCOLOR(1)); + SEGMENT.fade_out(254); uint16_t counter = strip.now * (6 + (SEGMENT.speed >> 4)); uint16_t numBirds = 2 + (SEGLEN >> 3); // 2 + 1/8 of a segment uint16_t span = (SEGMENT.intensity << 8) / numBirds; diff --git a/wled00/FX_fcn.cpp b/wled00/FX_fcn.cpp index 4edf05c1..6cfe8c0b 100644 --- a/wled00/FX_fcn.cpp +++ b/wled00/FX_fcn.cpp @@ -460,12 +460,13 @@ void IRAM_ATTR Segment::setPixelColor(int i, uint32_t col) break; } return; - } else if (width()==1 && height()>1) { - // we have a vertical 1D segment - setPixelColorXY(0, i, col); // transpose - } else if (width()>1 && height()==1) { - // we have a horizontal 1D segment - setPixelColorXY(i, 0, col); + } else if (width()==1 || height()==1) { + int x = 0, y = 0; + // we have a vertical or horizontal 1D segment + if (height()>1) { y = i; } + if (width()>1 ) { x = i; } + if (transpose ) { int t = x; x = y; y = t; } + setPixelColorXY(x, y, col); } #endif diff --git a/wled00/data/index.js b/wled00/data/index.js index 9438db98..0167aea7 100644 --- a/wled00/data/index.js +++ b/wled00/data/index.js @@ -774,7 +774,7 @@ function populateSegments(s) ${!isM?rvXck:''} ${isM&&stoY-staY>1&&stoX-staX>1?map2D:''} ${s.AudioReactive && s.AudioReactive.on ? "" : sndSim} -