From ec3c7ad29cc229228c5266f4458c10f3ad19a3e5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mi=C5=82osz=20Grocholewski?= <m.grocholewski@atcomp.pl>
Date: Wed, 30 Oct 2024 15:44:21 +0100
Subject: [PATCH] fix(vector-map): correct first point assignment in Bezier
 curve

---
 .../MapViewerVector/utils/shapes/coords/getPolygonCoords.ts   | 4 +++-
 1 file changed, 3 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 f0fd77ba..69af893a 100644
--- a/src/components/Map/MapViewer/MapViewerVector/utils/shapes/coords/getPolygonCoords.ts
+++ b/src/components/Map/MapViewer/MapViewerVector/utils/shapes/coords/getPolygonCoords.ts
@@ -45,6 +45,8 @@ export default function getPolygonCoords({
       return [[...lastPoint]];
     }
     const { p1, p2, p3 } = getCurveCoords({ x, y, point, height, width, pointToProjection });
-    return getBezierCurve({ p0: lastPoint, p1, p2, p3, numPoints: 20 });
+    const p0 = lastPoint;
+    lastPoint = p3;
+    return getBezierCurve({ p0, p1, p2, p3, numPoints: 20 });
   });
 }
-- 
GitLab