From b842b9b5ddab0943bf118e94fea90886cad61760 Mon Sep 17 00:00:00 2001 From: hamed musallam Date: Thu, 2 May 2024 14:43:54 +0200 Subject: [PATCH] refactor: truncate the link angle value to one decimal --- src/component/2d/zones/ZonesAssignmentsLabels.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/component/2d/zones/ZonesAssignmentsLabels.tsx b/src/component/2d/zones/ZonesAssignmentsLabels.tsx index b8104eb098..16bbcd9e1b 100644 --- a/src/component/2d/zones/ZonesAssignmentsLabels.tsx +++ b/src/component/2d/zones/ZonesAssignmentsLabels.tsx @@ -72,7 +72,7 @@ function findBestLink( const deltaLength = getDistance(a.x, a.y, b.x, b.y); const distance = Math.min(aLength, bLength); - const angle = getAngleFromSides(deltaLength, aLength, bLength); + const angle = Number(getAngleFromSides(deltaLength, aLength, bLength).toFixed(1)); result.push({ distance, angle, targetPoint, sourcePoint }); } @@ -85,7 +85,6 @@ function findBestLink( return a.distance - b.distance; } }); - return result[0]; }