Set dimension to fixed 2
This commit is contained in:
parent
ee7c418b24
commit
5aaf1f4745
3 changed files with 11 additions and 5 deletions
|
@ -59,7 +59,7 @@ export function Container(props: IContainerProps): JSX.Element {
|
|||
const xEnd = width;
|
||||
const yDim = -dimensionMargin;
|
||||
const strokeWidth = 1;
|
||||
const text = (width ?? 0).toString();
|
||||
const text = (width.toFixed(2) ?? 0).toString();
|
||||
|
||||
let childrenDimensions: JSX.Element | null = null;
|
||||
if (props.model.properties.showChildrenDimensions && props.model.children.length > 1 && SHOW_CHILDREN_DIMENSIONS) {
|
||||
|
@ -109,7 +109,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).toString()} />);
|
||||
text={(next - cur).toFixed(2).toString()} />);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
@ -167,7 +167,9 @@ function GetChildrenDimensionProps(props: IContainerProps, dimensionMargin: numb
|
|||
}
|
||||
|
||||
const yChildren = props.model.properties.height + dimensionMargin;
|
||||
const textChildren = (xChildrenEnd - xChildrenStart).toString();
|
||||
const textChildren = (xChildrenEnd - xChildrenStart)
|
||||
.toFixed(2)
|
||||
.toString();
|
||||
return { childrenId, xChildrenStart, xChildrenEnd, yChildren, textChildren };
|
||||
}
|
||||
|
||||
|
|
|
@ -70,7 +70,9 @@ function AddNewDimension(currentDepth: number, min: number, max: number, lastY:
|
|||
const y = lastY + (DIMENSION_MARGIN * (currentDepth + 1));
|
||||
const strokeWidth = 1;
|
||||
const width = xEnd - xStart;
|
||||
const text = width.toString();
|
||||
const text = width
|
||||
.toFixed(2)
|
||||
.toString();
|
||||
|
||||
if (width === 0) {
|
||||
return;
|
||||
|
|
|
@ -18,7 +18,9 @@ function GetDimensionsNodes(root: ContainerModel): React.ReactNode[] {
|
|||
const xEnd = xStart + width;
|
||||
const y = (container.properties.y + container.properties.height) + (DIMENSION_MARGIN * (depth + 1));
|
||||
const strokeWidth = 1;
|
||||
const text = width.toString();
|
||||
const text = width
|
||||
.toFixed(2)
|
||||
.toString();
|
||||
dimensions.push(
|
||||
<Dimension
|
||||
key={id}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue