Merge branch 'bugfix' into 0_15

This commit is contained in:
Blaz Kristan 2023-10-01 13:27:18 +02:00
commit 76e0e935f0
6 changed files with 1543 additions and 1535 deletions

View File

@ -2276,7 +2276,7 @@ uint16_t mode_meteor() {
} }
// draw meteor // draw meteor
for (int j = 0; j < meteorSize; j++) { for (unsigned j = 0; j < meteorSize; j++) {
uint16_t index = in + j; uint16_t index = in + j;
if (index >= SEGLEN) { if (index >= SEGLEN) {
index -= SEGLEN; index -= SEGLEN;
@ -2315,7 +2315,7 @@ uint16_t mode_meteor_smooth() {
} }
// draw meteor // draw meteor
for (int j = 0; j < meteorSize; j++) { for (unsigned j = 0; j < meteorSize; j++) {
uint16_t index = in + j; uint16_t index = in + j;
if (index >= SEGLEN) { if (index >= SEGLEN) {
index -= SEGLEN; index -= SEGLEN;

View File

@ -1535,7 +1535,7 @@ void WS2812FX::purgeSegments(bool force) {
} }
if (deleted) { if (deleted) {
_segments.shrink_to_fit(); _segments.shrink_to_fit();
if (_mainSegment >= _segments.size()) setMainSegmentId(0); /*if (_mainSegment >= _segments.size())*/ setMainSegmentId(0);
} }
} }

View File

@ -1034,6 +1034,7 @@ textarea {
/*padding: 1px 0 1px 20px;*/ /*padding: 1px 0 1px 20px;*/
display: var(--sgp); display: var(--sgp);
width: 100%; width: 100%;
position: relative;
} }
.pname { .pname {

View File

@ -845,7 +845,7 @@ function populateSegments(s)
} }
if (segCount < 2) { if (segCount < 2) {
gId(`segd${lSeg}`).classList.add("hide"); gId(`segd${lSeg}`).classList.add("hide");
gId(`segp0`).classList.add("hide"); if (parseInt(gId("seg0bri").value)==255) gId(`segp0`).classList.add("hide");
} }
if (!isM && !noNewSegs && (cfg.comp.seglen?parseInt(gId(`seg${lSeg}s`).value):0)+parseInt(gId(`seg${lSeg}e`).value)<ledCount) gId(`segr${lSeg}`).classList.remove("hide"); if (!isM && !noNewSegs && (cfg.comp.seglen?parseInt(gId(`seg${lSeg}s`).value):0)+parseInt(gId(`seg${lSeg}e`).value)<ledCount) gId(`segr${lSeg}`).classList.remove("hide");
gId('segutil2').style.display = (segCount > 1) ? "block":"none"; // rsbtn parent gId('segutil2').style.display = (segCount > 1) ? "block":"none"; // rsbtn parent

File diff suppressed because it is too large Load Diff

View File

@ -20,6 +20,7 @@ bool deserializeSegment(JsonObject elem, byte it, byte presetId)
byte id = elem["id"] | it; byte id = elem["id"] | it;
if (id >= strip.getMaxSegments()) return false; if (id >= strip.getMaxSegments()) return false;
bool newSeg = false;
int stop = elem["stop"] | -1; int stop = elem["stop"] | -1;
// append segment // append segment
@ -27,6 +28,7 @@ bool deserializeSegment(JsonObject elem, byte it, byte presetId)
if (stop <= 0) return false; // ignore empty/inactive segments if (stop <= 0) return false; // ignore empty/inactive segments
strip.appendSegment(Segment(0, strip.getLengthTotal())); strip.appendSegment(Segment(0, strip.getLengthTotal()));
id = strip.getSegmentsNum()-1; // segments are added at the end of list id = strip.getSegmentsNum()-1; // segments are added at the end of list
newSeg = true;
} }
//DEBUG_PRINTLN("-- JSON deserialize segment."); //DEBUG_PRINTLN("-- JSON deserialize segment.");
@ -118,8 +120,12 @@ bool deserializeSegment(JsonObject elem, byte it, byte presetId)
// do not call seg.setUp() here, as it may cause a crash due to concurrent access if the segment is currently drawing effects // do not call seg.setUp() here, as it may cause a crash due to concurrent access if the segment is currently drawing effects
// WS2812FX handles queueing of the change // WS2812FX handles queueing of the change
strip.setSegment(id, start, stop, grp, spc, of, startY, stopY); strip.setSegment(id, start, stop, grp, spc, of, startY, stopY);
if (newSeg) seg.refreshLightCapabilities(); // fix for #3403
if (seg.reset && seg.stop == 0) return true; // segment was deleted & is marked for reset, no need to change anything else if (seg.reset && seg.stop == 0) {
if (id == strip.getMainSegmentId()) strip.setMainSegmentId(0); // fix for #3403
return true; // segment was deleted & is marked for reset, no need to change anything else
}
byte segbri = seg.opacity; byte segbri = seg.opacity;
if (getVal(elem["bri"], &segbri)) { if (getVal(elem["bri"], &segbri)) {