mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-18 02:01:22 +01:00
fix: clip by bbox
This commit is contained in:
parent
392cc24f7c
commit
9bd90e51d9
6 changed files with 7 additions and 19 deletions
|
|
@ -37,10 +37,7 @@ export function drawCoastline() {
|
|||
let vchain = connectVertices(start, type);
|
||||
if (features[f].type === "lake") relax(vchain, 1.2);
|
||||
used[f] = 1;
|
||||
let points = clipPoly(
|
||||
vchain.map(v => vertices.p[v]),
|
||||
1
|
||||
);
|
||||
let points = clipPoly(vchain.map(v => vertices.p[v]));
|
||||
const area = d3.polygonArea(points); // area with lakes/islands
|
||||
if (area > 0 && features[f].type === "lake") {
|
||||
points = points.reverse();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue