mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 17:51:24 +01:00
fix: drawCoastline - detect first vertex based on neibs first
This commit is contained in:
parent
cc3c06f595
commit
4a15dc3243
5 changed files with 31 additions and 23 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import {getGridPolygon} from "utils/graphUtils";
|
||||
import {getGridPolygon, getPackPolygon} from "utils/graphUtils";
|
||||
|
||||
export function drawCells() {
|
||||
cells.selectAll("path").remove();
|
||||
|
|
@ -6,6 +6,6 @@ export function drawCells() {
|
|||
const cellIds = customization === 1 ? grid.cells.i : pack.cells.i;
|
||||
const getPolygon = customization === 1 ? getGridPolygon : getPackPolygon;
|
||||
|
||||
const paths = cellIds.map(getPolygon);
|
||||
const paths = Array.from(cellIds).map(getPolygon);
|
||||
cells.append("path").attr("d", "M" + paths.join("M"));
|
||||
}
|
||||
|
|
@ -11,17 +11,6 @@ export function drawCoastline(vertices: IGraphVertices, features: TPackFeatures)
|
|||
const lineGen = d3.line().curve(d3.curveBasisClosed);
|
||||
const SIMPLIFICATION_TOLERANCE = 0.3; // px
|
||||
|
||||
// map edge rectangle
|
||||
debug
|
||||
.append("rect")
|
||||
.attr("x", 0)
|
||||
.attr("y", 0)
|
||||
.attr("width", graphWidth)
|
||||
.attr("height", graphHeight)
|
||||
.attr("fill", "none")
|
||||
.attr("stroke", "black")
|
||||
.attr("stroke-width", 0.1);
|
||||
|
||||
for (const feature of features) {
|
||||
if (!feature) continue;
|
||||
if (feature.type === "ocean") continue;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue