New segment bugfix.

This commit is contained in:
Blaz Kristan
2022-09-06 15:47:41 +02:00
parent 3a1ddce13f
commit 8e03395b53
7 changed files with 2004 additions and 2002 deletions

View File

@@ -1043,7 +1043,7 @@ function updateLen(s)
let tPL = gId(`seg${s}lbtm`);
if (stop-start>1 && stopY-startY>1) {
// 2D segment
tPL.classList.remove("hide"); // unhide transpose checkbox
if (tPL) tPL.classList.remove("hide"); // unhide transpose checkbox
let sE = gId('fxlist').querySelector(`.lstI[data-id="${selectedFx}"]`);
if (sE) {
let sN = sE.querySelector(".lstIname").innerText;
@@ -1055,8 +1055,10 @@ function updateLen(s)
}
} else {
// 1D segment in 2D set-up
tPL.classList.add("hide"); // hide transpose checkbox
gId(`seg${s}tp`).checked = false; // and uncheck it
if (tPL) {
tPL.classList.add("hide"); // hide transpose checkbox
gId(`seg${s}tp`).checked = false; // and uncheck it
}
}
}
var out = "(delete)";
@@ -1996,15 +1998,15 @@ 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`)) {
if (gId(`seg${s}grp`)) { // advanced options, not present in new segment dialog (makeSeg())
var grp = parseInt(gId(`seg${s}grp`).value);
var spc = parseInt(gId(`seg${s}spc`).value);
var ofs = parseInt(gId(`seg${s}of` ).value);
obj.seg.grp = grp;
obj.seg.spc = spc;
obj.seg.of = ofs;
if (isM) obj.seg.tp = gId(`seg${s}tp`).checked;
}
requestJson(obj);
}