fix: features rendering - close the ring

This commit is contained in:
Azgaar 2024-10-13 20:32:37 +02:00
parent 6c37c7babf
commit c447afb829
4 changed files with 9 additions and 9 deletions

View file

@ -55,7 +55,7 @@ function getFeaturePath(feature) {
const clippedPoints = clipPoly(simplifiedPoints, 1);
const lineGen = d3.line().curve(d3.curveBasisClosed);
const path = round(lineGen(clippedPoints));
const path = round(lineGen(clippedPoints)) + "Z";
return path;
}

View file

@ -15,7 +15,7 @@ function editLake() {
debug.append("g").attr("id", "vertices");
elSelected = d3.select(node);
updateLakeValues();
selectLakeGroup(node);
selectLakeGroup();
drawLakeVertices();
viewbox.on("touchmove mousemove", null);
@ -140,13 +140,13 @@ function editLake() {
lake.name = lakeName.value = Names.getBase(rand(nameBases.length - 1));
}
function selectLakeGroup(node) {
const group = node.parentNode.id;
function selectLakeGroup() {
const lake = getLake();
const select = byId("lakeGroup");
select.options.length = 0; // remove all options
lakes.selectAll("g").each(function () {
select.options.add(new Option(this.id, this.id, false, this.id === group));
select.options.add(new Option(this.id, this.id, false, this.id === lake.group));
});
}