fix: #1118 - get lake shoreline if missing

This commit is contained in:
Azgaar 2024-09-01 21:42:34 +02:00
parent d1fcdf20f7
commit 59462a4f15
2 changed files with 9 additions and 3 deletions

View file

@ -21,7 +21,10 @@ function getVertexPaths({getType, options}) {
if (onborderCell === undefined) continue; if (onborderCell === undefined) continue;
const feature = pack.features[cells.f[onborderCell]]; const feature = pack.features[cells.f[onborderCell]];
if (feature.type === "lake" && feature.shoreline.every(ofSameType)) continue; // inner lake if (feature.type === "lake") {
if (!feature.shoreline) Lakes.getShoreline(feature);
if (feature.shoreline.every(ofSameType)) continue; // inner lake
}
const startingVertex = cells.v[cellId].find(v => vertices.c[v].some(ofDifferentType)); const startingVertex = cells.v[cellId].find(v => vertices.c[v].some(ofDifferentType));
if (startingVertex === undefined) throw new Error(`Starting vertex for cell ${cellId} is not found`); if (startingVertex === undefined) throw new Error(`Starting vertex for cell ${cellId} is not found`);
@ -104,7 +107,10 @@ function getVertexPath(cellsArray) {
if (onborderCell === undefined) continue; if (onborderCell === undefined) continue;
const feature = pack.features[cells.f[onborderCell]]; const feature = pack.features[cells.f[onborderCell]];
if (feature.type === "lake" && feature.shoreline.every(ofSameType)) continue; // inner lake if (feature.type === "lake") {
if (!feature.shoreline) Lakes.getShoreline(feature);
if (feature.shoreline.every(ofSameType)) continue; // inner lake
}
const startingVertex = cells.v[cellId].find(v => vertices.c[v].some(ofDifferentType)); const startingVertex = cells.v[cellId].find(v => vertices.c[v].some(ofDifferentType));
if (startingVertex === undefined) throw new Error(`Starting vertex for cell ${cellId} is not found`); if (startingVertex === undefined) throw new Error(`Starting vertex for cell ${cellId} is not found`);

View file

@ -12,7 +12,7 @@
* *
* Example: 1.102.0 -> Major version 1, Minor version 102, Patch version 0 * Example: 1.102.0 -> Major version 1, Minor version 102, Patch version 0
*/ */
const VERSION = "1.101.00"; const VERSION = "1.101.01";
{ {
document.title += " v" + VERSION; document.title += " v" + VERSION;