diff --git a/index.css b/index.css index 46719fe7..256d84e6 100644 --- a/index.css +++ b/index.css @@ -1741,22 +1741,16 @@ rect.fillRect { fill: none; } -#ruler circle { +#ruler .rulerPoints { stroke: #4e5a69; fill: yellow; cursor: grab; } -#ruler circle.control { +#ruler .rulerPoints .control { fill: #999999; } -#ruler rect { - stroke: #3d3d3d; - fill: yellow; - cursor: col-resize; -} - #ruler .white { stroke: white; } @@ -1769,13 +1763,12 @@ rect.fillRect { #ruler text { font-family: 'Georgia'; fill: #3d3d3d; - stroke: none; text-anchor: middle; text-shadow: 0 0 4px white; cursor: pointer; } -#ruler .planimeter { +#ruler path.planimeter { fill: lightblue; fill-rule: evenodd; fill-opacity: 0.5; diff --git a/modules/save-and-load.js b/modules/save-and-load.js index 9d4a5e8c..317e212e 100644 --- a/modules/save-and-load.js +++ b/modules/save-and-load.js @@ -212,7 +212,7 @@ function inlineStyle(clone) { const emptyG = clone.append("g").node(); const defaultStyles = window.getComputedStyle(emptyG); - clone.selectAll("g, #ruler > g > *, #scaleBar > text").each(function() { + clone.selectAll("g, #ruler *, #scaleBar > text").each(function() { const compStyle = window.getComputedStyle(this); let style = ""; diff --git a/modules/ui/general.js b/modules/ui/general.js index 063e37fe..bf58fe06 100644 --- a/modules/ui/general.js +++ b/modules/ui/general.js @@ -138,10 +138,10 @@ function showMapTooltip(point, e, i, g) { if (group === "labels") {tip("Click to edit the Label"); return;} if (group === "markers") {tip("Click to edit the Marker"); return;} if (group === "ruler") { - if (tag === "rect") {tip("Drag to split the ruler into 2 parts"); return;} if (tag === "circle") {tip("Drag to adjust the measurer"); return;} - if (tag === "path" || tag === "line") {tip("Drag to move the measurer"); return;} - if (tag === "text") {tip("Click to remove the measurer"); return;} + if (tag === "path") {tip("Drag to move the measurer"); return;} + if (tag === "polyline") {tip("Drag to add a control point"); return;} + if (tag === "text") {tip("Drag to move, click to remove the measurer"); return;} } if (subgroup === "burgIcons") {tip("Click to edit the Burg"); return;} if (subgroup === "burgLabels") {tip("Click to edit the Burg"); return;} diff --git a/modules/ui/units-editor.js b/modules/ui/units-editor.js index 8e97ee88..eaf53ad1 100644 --- a/modules/ui/units-editor.js +++ b/modules/ui/units-editor.js @@ -235,6 +235,7 @@ function editUnits() { restoreDefaultEvents(); clearMainTip(); addOpisometer.classList.remove("pressed"); + if (opisometer.points.length < 2) rulers.remove(opisometer.id); if (!d3.event.sourceEvent.shiftKey) opisometer.optimize(); }); })); @@ -264,7 +265,8 @@ function editUnits() { restoreDefaultEvents(); clearMainTip(); addPlanimeter.classList.remove("pressed"); - if (!d3.event.sourceEvent.shiftKey) planimeter.optimize(); + if (planimeter.points.length < 3) rulers.remove(planimeter.id); + else if (!d3.event.sourceEvent.shiftKey) planimeter.optimize(); }); }));