From c558029992cf9fa6fdcf165859acf5a15e6670b2 Mon Sep 17 00:00:00 2001 From: Azgaar Date: Wed, 18 Dec 2019 23:47:49 +0300 Subject: [PATCH] v1.22.29 --- modules/ui/burg-editor.js | 2 +- modules/ui/rivers-editor.js | 10 +++++++++- modules/ui/routes-editor.js | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/modules/ui/burg-editor.js b/modules/ui/burg-editor.js index 691b5f43..8867c6f1 100644 --- a/modules/ui/burg-editor.js +++ b/modules/ui/burg-editor.js @@ -10,7 +10,7 @@ function editBurg(id) { burgLabels.selectAll("text").call(d3.drag().on("start", dragBurgLabel)).classed("draggable", true); updateBurgValues(); - const my = id || d3.event.target.tagName === "text" ? "center bottom" : "center top+10"; + const my = id || d3.event.target.tagName === "text" ? "center bottom-20" : "center top+20"; const at = id ? "center" : d3.event.target.tagName === "text" ? "top" : "bottom"; const of = id ? "svg" : d3.event.target; diff --git a/modules/ui/rivers-editor.js b/modules/ui/rivers-editor.js index c76ce90d..157c0dcd 100644 --- a/modules/ui/rivers-editor.js +++ b/modules/ui/rivers-editor.js @@ -10,10 +10,11 @@ function editRiver(id) { viewbox.on("touchmove mousemove", showEditorTips); debug.append("g").attr("id", "controlPoints").attr("transform", elSelected.attr("transform")); drawControlPoints(node); + updateRiverName(node); $("#riverEditor").dialog({ title: "Edit River", resizable: false, - position: {my: "center top+20", at: "top", of: node, collision: "fit"}, + position: {my: "center top+80", at: "top", of: node, collision: "fit"}, close: closeRiverEditor }); @@ -44,6 +45,13 @@ function editRiver(id) { if (d3.event.target.parentNode.id === "controlPoints") tip("Drag to move, click to delete the control point"); } + function updateRiverName(node) { + const river = +node.id.slice(5); + const r = pack.rivers.find(r => r.i === river); + riverName.value = r.name; + riverType.value = r.type; + } + function drawControlPoints(node) { const l = node.getTotalLength() / 2; const segments = Math.ceil(l / 8); diff --git a/modules/ui/routes-editor.js b/modules/ui/routes-editor.js index 28571f00..b1f30c67 100644 --- a/modules/ui/routes-editor.js +++ b/modules/ui/routes-editor.js @@ -7,7 +7,7 @@ function editRoute(onClick) { $("#routeEditor").dialog({ title: "Edit Route", resizable: false, - position: {my: "center top+20", at: "top", of: d3.event, collision: "fit"}, + position: {my: "center top+60", at: "top", of: d3.event, collision: "fit"}, close: closeRoutesEditor });