Skip to content

Commit

Permalink
fix(map,data): fix crash when border width == 0
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelMakesGames committed Feb 27, 2024
1 parent d1fa070 commit 9ffc45c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/renderer/src/lib/map/data/processBorders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,11 @@ export default function processBorders(
? ''
: multiPolygonToPath(smoothedInnerBorderGeoJSON, settings.borderStroke.smoothing);
const borderOnlyGeoJSON =
smoothedInnerBorderGeoJSON == null || smoothedOuterBorderGeoJSON == null
? smoothedOuterBorderGeoJSON
: turf.difference(smoothedOuterBorderGeoJSON, smoothedInnerBorderGeoJSON);
settings.borderStroke.width === 0
? null
: smoothedInnerBorderGeoJSON == null || smoothedOuterBorderGeoJSON == null
? smoothedOuterBorderGeoJSON
: turf.difference(smoothedOuterBorderGeoJSON, smoothedInnerBorderGeoJSON);
border.borderPath = borderOnlyGeoJSON
? multiPolygonToPath(borderOnlyGeoJSON, settings.borderStroke.smoothing)
: '';
Expand Down

0 comments on commit 9ffc45c

Please sign in to comment.