From 723b99e05691df1a818026d0a14e1c640d013131 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C5=82osz=20Grocholewski?= <m.grocholewski@atcomp.pl> Date: Fri, 10 Jan 2025 11:38:51 +0100 Subject: [PATCH] fix(vector-map): correct numPoints for bezier curve --- .../MapViewerVector/utils/shapes/coords/getPolygonCoords.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/Map/MapViewer/MapViewerVector/utils/shapes/coords/getPolygonCoords.ts b/src/components/Map/MapViewer/MapViewerVector/utils/shapes/coords/getPolygonCoords.ts index 9f68ed47..d00816b5 100644 --- a/src/components/Map/MapViewer/MapViewerVector/utils/shapes/coords/getPolygonCoords.ts +++ b/src/components/Map/MapViewer/MapViewerVector/utils/shapes/coords/getPolygonCoords.ts @@ -47,6 +47,10 @@ export default function getPolygonCoords({ const { p1, p2, p3 } = getCurveCoords({ x, y, point, height, width, pointToProjection }); const p0 = lastPoint; lastPoint = p3; - return getBezierCurve({ p0, p1, p2, p3, numPoints: 3 }); + let numPoints = 3; + if (p0[0] === p3[0] || p0[1] === p3[1]) { + numPoints = 9; + } + return getBezierCurve({ p0, p1, p2, p3, numPoints }); }); } -- GitLab