@@ -886,8 +886,8 @@ function updateLen(s)
{
if (!d.getElementById(`seg${s}s`)) return;
var start = parseInt(d.getElementById(`seg${s}s`).value);
- var stop = parseInt(d.getElementById(`seg${s}e`).value);
- var len = stop - start;
+ var stop = parseInt(d.getElementById(`seg${s}e`).value);
+ var len = stop - (cfg.comp.seglen?0:start);
var out = "(delete)";
if (len > 1) {
out = `${len} LEDs`;
@@ -1234,7 +1234,7 @@ function makeSeg()
{
var ns = 0;
if (lowestUnused > 0) {
- var pend = d.getElementById(`seg${lowestUnused -1}e`).value;
+ var pend = parseInt(d.getElementById(`seg${lowestUnused -1}e`).value,10) + (cfg.comp.seglen?parseInt(d.getElementById(`seg${lowestUnused -1}s`).value,10):0);
if (pend < ledCount) ns = pend;
}
var cn = `
@@ -1245,16 +1245,16 @@ function makeSeg()
Start LED
-
Stop LED
+
${cfg.comp.seglen?"LED count":"Stop LED"}
-
+
${ledCount - ns} LEDs
-
+
`;
d.getElementById('segutil').innerHTML = cn;
@@ -1342,9 +1342,9 @@ function selSeg(s)
function setSeg(s)
{
var start = parseInt(d.getElementById(`seg${s}s`).value);
- var stop = parseInt(d.getElementById(`seg${s}e`).value);
- if (stop <= start) {delSeg(s); return;}
- var obj = {"seg": {"id": s, "start": start, "stop": stop}};
+ var stop = parseInt(d.getElementById(`seg${s}e`).value);
+ if (stop == 0) {delSeg(s); return;}
+ var obj = {"seg": {"id": s, "start": start, "stop": (cfg.comp.seglen?start:0)+stop}};
if (d.getElementById(`seg${s}grp`))
{
var grp = parseInt(d.getElementById(`seg${s}grp`).value);
diff --git a/wled00/data/settings_ui.htm b/wled00/data/settings_ui.htm
index 6ae07834..a38e6cd4 100644
--- a/wled00/data/settings_ui.htm
+++ b/wled00/data/settings_ui.htm
@@ -1,7 +1,7 @@
-
+
UI Settings