From b081a09962f46f1f97153fe9f73eacba33e13a20 Mon Sep 17 00:00:00 2001 From: David Luzar Date: Fri, 26 Mar 2021 21:56:27 +0100 Subject: [PATCH] fix: positions stats for linear elements (#3331) --- src/components/Stats.tsx | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/src/components/Stats.tsx b/src/components/Stats.tsx index 56b3e2c0..9fbf3bbe 100644 --- a/src/components/Stats.tsx +++ b/src/components/Stats.tsx @@ -120,31 +120,17 @@ export const Stats = (props: { <> {"x"} - - {Math.round( - selectedElements.length === 1 - ? selectedElements[0].x - : selectedBoundingBox[0], - )} - + {Math.round(selectedBoundingBox[0])} {"y"} - - {Math.round( - selectedElements.length === 1 - ? selectedElements[0].y - : selectedBoundingBox[1], - )} - + {Math.round(selectedBoundingBox[1])} {t("stats.width")} {Math.round( - selectedElements.length === 1 - ? selectedElements[0].width - : selectedBoundingBox[2] - selectedBoundingBox[0], + selectedBoundingBox[2] - selectedBoundingBox[0], )} @@ -152,9 +138,7 @@ export const Stats = (props: { {t("stats.height")} {Math.round( - selectedElements.length === 1 - ? selectedElements[0].height - : selectedBoundingBox[3] - selectedBoundingBox[1], + selectedBoundingBox[3] - selectedBoundingBox[1], )}