From 320d68e27f304db5100bc7186cbe292cdbffaa54 Mon Sep 17 00:00:00 2001 From: Guillaume Tauzin Date: Fri, 16 Sep 2022 10:07:01 +0200 Subject: [PATCH] Text cotation css modified + no decimal display on text --- src/Components/SVG/Elements/Container.tsx | 4 ++-- src/Components/SVG/Elements/DepthDimensionLayer.tsx | 2 +- src/Components/SVG/Elements/DimensionLayer.tsx | 2 +- src/Components/SVG/SVG.scss | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Components/SVG/Elements/Container.tsx b/src/Components/SVG/Elements/Container.tsx index 300984e..82727b3 100644 --- a/src/Components/SVG/Elements/Container.tsx +++ b/src/Components/SVG/Elements/Container.tsx @@ -65,7 +65,7 @@ export function Container(props: IContainerProps): JSX.Element { const xEnd = width; const yDim = -dimensionMargin; const strokeWidth = 1; - const text = (width.toFixed(2) ?? 0).toString(); + const text = (width.toFixed(0) ?? 0).toString(); let childrenDimensions: JSX.Element | null = null; if (props.model.properties.showChildrenDimensions && props.model.children.length > 1 && SHOW_CHILDREN_DIMENSIONS) { @@ -116,7 +116,7 @@ export function Container(props: IContainerProps): JSX.Element { yStart={props.model.properties.height + yDim * -1} yEnd={props.model.properties.height + yDim * -1} strokeWidth={strokeWidth} - text={(next - cur).toFixed(2).toString()} + text={(next - cur).toFixed(0).toString()} scale={props.scale} />); count++; diff --git a/src/Components/SVG/Elements/DepthDimensionLayer.tsx b/src/Components/SVG/Elements/DepthDimensionLayer.tsx index 884b4ee..5efbfc5 100644 --- a/src/Components/SVG/Elements/DepthDimensionLayer.tsx +++ b/src/Components/SVG/Elements/DepthDimensionLayer.tsx @@ -74,7 +74,7 @@ function AddNewDimension(currentDepth: number, min: number, max: number, lastY: const strokeWidth = 1; const width = xEnd - xStart; const text = width - .toFixed(2) + .toFixed(0) .toString(); if (width === 0) { diff --git a/src/Components/SVG/Elements/DimensionLayer.tsx b/src/Components/SVG/Elements/DimensionLayer.tsx index 588b782..0042db2 100644 --- a/src/Components/SVG/Elements/DimensionLayer.tsx +++ b/src/Components/SVG/Elements/DimensionLayer.tsx @@ -19,7 +19,7 @@ function GetDimensionsNodes(root: ContainerModel): React.ReactNode[] { const y = (container.properties.y + container.properties.height) + (DIMENSION_MARGIN * (depth + 1)); const strokeWidth = 1; const text = width - .toFixed(2) + .toFixed(0) .toString(); dimensions.push(