mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-16 17:31:24 +01:00
fix: drawStateLabels - remove correct elements
This commit is contained in:
parent
bea278df6c
commit
8a817b568e
1 changed files with 3 additions and 3 deletions
|
|
@ -114,7 +114,7 @@ function getLabelPaths(features: TPackFeatures, featureIds: Uint16Array, stateId
|
|||
|
||||
function isPassable(cellId: number) {
|
||||
const feature = features[featureIds[cellId]];
|
||||
if (isLake(feature) && feature.cells <= maxLakeSize) return true;
|
||||
if (isLake(feature)) return feature.cells <= maxLakeSize;
|
||||
return stateIds[cellId] === stateId;
|
||||
}
|
||||
}
|
||||
|
|
@ -136,8 +136,8 @@ function drawLabelPath(stateIds: Uint16Array, states: TStates, labelPaths: [numb
|
|||
if (!isState(state)) throw new Error("State must not be neutral");
|
||||
if (pathPoints.length < 2) throw new Error("Label path must have at least 2 points");
|
||||
|
||||
textGroup.select("#textPath_stateLabel" + stateId).remove();
|
||||
pathGroup.select("#stateLabel" + stateId).remove();
|
||||
textGroup.select("#stateLabel" + stateId).remove();
|
||||
pathGroup.select("#textPath_stateLabel" + stateId).remove();
|
||||
|
||||
const textPath = pathGroup
|
||||
.append("path")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue