Fix 0 dimension showing in children dimension
This commit is contained in:
parent
b88539e34d
commit
b463c3050c
1 changed files with 11 additions and 1 deletions
|
@ -96,7 +96,7 @@ function Dimensions({ root, scale }: IDimensionLayerProps): React.ReactNode[] {
|
|||
);
|
||||
}
|
||||
|
||||
if (SHOW_CHILDREN_DIMENSIONS && container.properties.showChildrenDimensions.length > 0 && container.children.length > 1) {
|
||||
if (SHOW_CHILDREN_DIMENSIONS && container.properties.showChildrenDimensions.length > 0) {
|
||||
ActionByPosition(
|
||||
dimMapped,
|
||||
container.properties.showChildrenDimensions,
|
||||
|
@ -154,6 +154,11 @@ function AddHorizontalChildrenDimension(
|
|||
}
|
||||
}
|
||||
|
||||
if (xChildrenStart === xChildrenEnd) {
|
||||
// do not show an empty dimension
|
||||
return;
|
||||
}
|
||||
|
||||
const textChildren = (xChildrenEnd - xChildrenStart)
|
||||
.toFixed(2)
|
||||
.toString();
|
||||
|
@ -197,6 +202,11 @@ function AddVerticalChildrenDimension(
|
|||
}
|
||||
}
|
||||
|
||||
if (yChildrenStart === yChildrenEnd) {
|
||||
// do not show an empty dimension
|
||||
return;
|
||||
}
|
||||
|
||||
const textChildren = (yChildrenEnd - yChildrenStart)
|
||||
.toFixed(2)
|
||||
.toString();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue