From 672d0017d2ff58ef1aba31e9a2d217047043e42d Mon Sep 17 00:00:00 2001 From: Carl Fuchs Date: Wed, 1 Feb 2023 09:08:03 +0100 Subject: [PATCH] Fix #8252 --- src/Components/SVG/Elements/DimensionLayer.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Components/SVG/Elements/DimensionLayer.tsx b/src/Components/SVG/Elements/DimensionLayer.tsx index 67054e1..4b7995b 100644 --- a/src/Components/SVG/Elements/DimensionLayer.tsx +++ b/src/Components/SVG/Elements/DimensionLayer.tsx @@ -505,7 +505,7 @@ function AddHorizontalSelfMarginsDimension( ): void { const style = container.properties.dimensionOptions.selfMarginsDimensions; const left = container.properties.margin.left; - if (left != null) { + if (left != null && left > 0) { const id = `dim-y-margin-left${yDim.toFixed(0)}-${container.properties.id}`; const xStart = container.properties.x + currentTransform[0] - left; const xEnd = xStart + left; @@ -527,7 +527,7 @@ function AddHorizontalSelfMarginsDimension( } const right = container.properties.margin.right; - if (right != null) { + if (right != null && right > 0) { const id = `dim-y-margin-right${yDim.toFixed(0)}-${container.properties.id}`; const xStart = container.properties.x + container.properties.width + currentTransform[0]; const xEnd = xStart + right; @@ -559,7 +559,7 @@ function AddVerticalSelfMarginDimension( ): void { const style = container.properties.dimensionOptions.selfMarginsDimensions; const top = container.properties.margin.top; - if (top != null) { + if (top != null && top > 0) { const idVert = `dim-x-margin-top${xDim.toFixed(0)}-${container.properties.id}`; let yStart = container.properties.y + currentTransform[1]; let yEnd = yStart - top; @@ -585,7 +585,7 @@ function AddVerticalSelfMarginDimension( ); } const bottom = container.properties.margin.bottom; - if (bottom != null) { + if (bottom != null && bottom > 0) { const idVert = `dim-x-margin-bottom${xDim.toFixed(0)}-${container.properties.id}`; let yStart = container.properties.y + container.properties.height + bottom + currentTransform[1]; let yEnd = yStart - bottom;