Transpose fix.

This commit is contained in:
Blaz Kristan 2022-08-22 22:02:36 +02:00
parent 9cb6f95420
commit d3d8fdff13
4 changed files with 1888 additions and 1876 deletions

View File

@ -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;

View File

@ -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

View File

@ -774,7 +774,7 @@ function populateSegments(s)
${!isM?rvXck:''}
${isM&&stoY-staY>1&&stoX-staX>1?map2D:''}
${s.AudioReactive && s.AudioReactive.on ? "" : sndSim}
<label class="check revchkl">
<label class="check revchkl" id="seg${i}lbtm">
${isM?'Transpose':'Mirror effect'}
<input type="checkbox" id="seg${i}${isM?'tp':'mi'}" onchange="${(isM?'setTp(':'setMi(')+i})" ${isM?(inst.tp?"checked":""):(inst.mi?"checked":"")}>
<span class="checkmark"></span>
@ -1038,7 +1038,9 @@ function updateLen(s)
let startY = parseInt(gId(`seg${s}sY`).value);
let stopY = parseInt(gId(`seg${s}eY`).value);
len *= (stopY-(cfg.comp.seglen?0:startY));
let tPL = gId(`seg${s}lbtm`);
if (stop-start>1 && stopY-startY>1) {
tPL.classList.remove("hide");
let sE = gId('fxlist').querySelector(`.lstI[data-id="${selectedFx}"]`);
if (sE) {
let sN = sE.querySelector(".lstIname").innerText;
@ -1048,6 +1050,9 @@ function updateLen(s)
else seg.classList.add("hide");
}
}
} else {
tPL.classList.add("hide");
gId(`seg${s}tp`).checked = false;
}
}
var out = "(delete)";
@ -1982,6 +1987,7 @@ function setSeg(s)
var stopY = parseInt(gId(`seg${s}eY`).value);
obj.seg.startY = startY;
obj.seg.stopY = (cfg.comp.seglen?startY:0)+stopY;
obj.seg.tp = gId(`seg${s}tp`).checked;
}
if (gId(`seg${s}grp`)) {
var grp = parseInt(gId(`seg${s}grp`).value);

File diff suppressed because it is too large Load Diff