Compile fix.
Use virtualLength() in getPixelColor()
This commit is contained in:
parent
8b58d96aea
commit
e2b7b228c5
@ -135,7 +135,7 @@ uint16_t IRAM_ATTR WS2812FX::get2DPixelIndex(uint16_t x, uint16_t y, uint8_t seg
|
||||
return ((_segments[seg].startY + y) * matrixWidth) + _segments[seg].start + x;
|
||||
}
|
||||
|
||||
void IRAM_ATTR WS2812FX::setPixelColorXY(uint16_t x, uint16_t y, byte r, byte g, byte b, byte w)
|
||||
void IRAM_ATTR WS2812FX::setPixelColorXY(int x, int y, byte r, byte g, byte b, byte w)
|
||||
{
|
||||
if (!isMatrix) return; // not a matrix set-up
|
||||
|
||||
|
@ -521,14 +521,15 @@ uint8_t WS2812FX::getActiveSegmentsNum(void) {
|
||||
|
||||
uint32_t WS2812FX::getPixelColor(uint16_t i)
|
||||
{
|
||||
if (isMatrix) return getPixelColorXY(i, 0);
|
||||
if (isMatrix) return getPixelColorXY(i%matrixWidth, i/matrixWidth); // compatibility w/ non-effect fn
|
||||
|
||||
// get physical pixel
|
||||
i = i * SEGMENT.groupLength();;
|
||||
if (SEGMENT.getOption(SEG_OPTION_REVERSED)) {
|
||||
if (SEGMENT.getOption(SEG_OPTION_MIRROR)) i = (SEGMENT.length() - 1) / 2 - i; //only need to index half the pixels
|
||||
else i = (SEGMENT.length() - 1) - i;
|
||||
}
|
||||
if (SEGMENT.getOption(SEG_OPTION_REVERSED)) i = SEGMENT.virtualLength() - i - 1;
|
||||
i *= SEGMENT.groupLength();
|
||||
//if (SEGMENT.getOption(SEG_OPTION_REVERSED)) {
|
||||
// if (SEGMENT.getOption(SEG_OPTION_MIRROR)) i = (SEGMENT.length() - 1) / 2 - i; //only need to index half the pixels
|
||||
// else i = (SEGMENT.length() - 1) - i;
|
||||
//}
|
||||
i += SEGMENT.start;
|
||||
|
||||
if (SEGLEN) {
|
||||
|
@ -605,7 +605,6 @@ function parseInfo(i) {
|
||||
mh = i.leds.matrix ? i.leds.matrix.h : 0;
|
||||
isM = mw>0 && mh>0;
|
||||
if (!isM) hideModes("2D ");
|
||||
else gId('buttonSr').classList.add("hide"); // peek does not work in 2D
|
||||
if (!i.u || !i.u.AudioReactive) { /*hideModes("♪ ");*/ hideModes("♫ "); } // hide /*audio*/ frequency reactive effects
|
||||
}
|
||||
|
||||
|
1582
wled00/html_ui.h
1582
wled00/html_ui.h
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user