mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 09:41:24 +01:00
v1.22.29
This commit is contained in:
parent
71d1e54dfc
commit
c558029992
3 changed files with 11 additions and 3 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue