mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-22 03:51:23 +01:00
feat: edit routes - start
This commit is contained in:
parent
681d97b2a7
commit
d6c01c8995
3 changed files with 39 additions and 40 deletions
|
|
@ -791,15 +791,15 @@ function toggleAddRoute() {
|
|||
|
||||
function addRouteOnClick() {
|
||||
unpressClickToAddButton();
|
||||
const point = d3.mouse(this);
|
||||
const id = getNextId("route");
|
||||
elSelected = routes
|
||||
const [x, y] = d3.mouse(this);
|
||||
|
||||
const newRoute = routes
|
||||
.select("g")
|
||||
.append("path")
|
||||
.attr("id", id)
|
||||
.attr("id", getNextId("route"))
|
||||
.attr("data-new", 1)
|
||||
.attr("d", `M${point[0]},${point[1]}`);
|
||||
editRoute(true);
|
||||
.attr("d", `M${x},${y}`);
|
||||
editRoute({node: newRoute.node(), mode: "onclick"});
|
||||
}
|
||||
|
||||
function toggleAddMarker() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue