fix: positions stats for linear elements (#3331)
This commit is contained in:
parent
10a23a10a5
commit
b081a09962
@ -120,31 +120,17 @@ export const Stats = (props: {
|
|||||||
<>
|
<>
|
||||||
<tr>
|
<tr>
|
||||||
<td>{"x"}</td>
|
<td>{"x"}</td>
|
||||||
<td>
|
<td>{Math.round(selectedBoundingBox[0])}</td>
|
||||||
{Math.round(
|
|
||||||
selectedElements.length === 1
|
|
||||||
? selectedElements[0].x
|
|
||||||
: selectedBoundingBox[0],
|
|
||||||
)}
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>{"y"}</td>
|
<td>{"y"}</td>
|
||||||
<td>
|
<td>{Math.round(selectedBoundingBox[1])}</td>
|
||||||
{Math.round(
|
|
||||||
selectedElements.length === 1
|
|
||||||
? selectedElements[0].y
|
|
||||||
: selectedBoundingBox[1],
|
|
||||||
)}
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>{t("stats.width")}</td>
|
<td>{t("stats.width")}</td>
|
||||||
<td>
|
<td>
|
||||||
{Math.round(
|
{Math.round(
|
||||||
selectedElements.length === 1
|
selectedBoundingBox[2] - selectedBoundingBox[0],
|
||||||
? selectedElements[0].width
|
|
||||||
: selectedBoundingBox[2] - selectedBoundingBox[0],
|
|
||||||
)}
|
)}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -152,9 +138,7 @@ export const Stats = (props: {
|
|||||||
<td>{t("stats.height")}</td>
|
<td>{t("stats.height")}</td>
|
||||||
<td>
|
<td>
|
||||||
{Math.round(
|
{Math.round(
|
||||||
selectedElements.length === 1
|
selectedBoundingBox[3] - selectedBoundingBox[1],
|
||||||
? selectedElements[0].height
|
|
||||||
: selectedBoundingBox[3] - selectedBoundingBox[1],
|
|
||||||
)}
|
)}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user