diff --git a/index.html b/index.html index 4a97d69b..1fb860ab 100644 --- a/index.html +++ b/index.html @@ -7876,7 +7876,7 @@ - + diff --git a/modules/ui/routes-editor.js b/modules/ui/routes-editor.js index 785c22a9..ca52b036 100644 --- a/modules/ui/routes-editor.js +++ b/modules/ui/routes-editor.js @@ -1,4 +1,7 @@ "use strict"; + +const CONTROL_POINST_DISTANCE = 10; + function editRoute(onClick) { if (customization) return; if (!onClick && elSelected && d3.event.target.id === elSelected.attr("id")) return; @@ -47,13 +50,13 @@ function editRoute(onClick) { } function drawControlPoints(node) { - const l = node.getTotalLength(); - const increment = l / Math.ceil(l / 4); - for (let i = 0; i <= l; i += increment) { + const totalLength = node.getTotalLength(); + const increment = totalLength / Math.ceil(totalLength / CONTROL_POINST_DISTANCE); + for (let i = 0; i <= totalLength; i += increment) { const point = node.getPointAtLength(i); addControlPoint([point.x, point.y]); } - routeLength.innerHTML = rn(l * distanceScaleInput.value) + " " + distanceUnitInput.value; + routeLength.innerHTML = rn(totalLength * distanceScaleInput.value) + " " + distanceUnitInput.value; } function addControlPoint(point, before = null) { diff --git a/versioning.js b/versioning.js index 257b6cda..734e3886 100644 --- a/versioning.js +++ b/versioning.js @@ -1,7 +1,7 @@ "use strict"; // version and caching control -const version = "1.89.03"; // generator version, update each time +const version = "1.89.04"; // generator version, update each time { document.title += " v" + version;