From 9ffc45c98f9a4a3dca9e78e9799d79de18e1732a Mon Sep 17 00:00:00 2001 From: Michael Moore Date: Mon, 26 Feb 2024 20:53:53 -0600 Subject: [PATCH] fix(map,data): fix crash when border width == 0 --- src/renderer/src/lib/map/data/processBorders.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/renderer/src/lib/map/data/processBorders.ts b/src/renderer/src/lib/map/data/processBorders.ts index 619e24a..cda0640 100644 --- a/src/renderer/src/lib/map/data/processBorders.ts +++ b/src/renderer/src/lib/map/data/processBorders.ts @@ -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) : '';