From 2772cc3e24e76acbbbef8c2c499fbe482331366a Mon Sep 17 00:00:00 2001 From: Eric NGUYEN Date: Tue, 21 Feb 2023 17:56:05 +0100 Subject: [PATCH] Fix syntax errors in DimensionLayer + fix possible bug in canvas where scale doesnt work for SelfDimensionMargins --- src/Components/Canvas/DimensionLayer.ts | 8 ++++---- src/Components/SVG/Elements/DimensionLayer.tsx | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Components/Canvas/DimensionLayer.ts b/src/Components/Canvas/DimensionLayer.ts index 061a4e0..df278a0 100644 --- a/src/Components/Canvas/DimensionLayer.ts +++ b/src/Components/Canvas/DimensionLayer.ts @@ -7,7 +7,8 @@ import { SHOW_BORROWER_DIMENSIONS, SHOW_CHILDREN_DIMENSIONS, DIMENSION_MARGIN, - SHOW_SELF_MARGINS_DIMENSIONS, DEFAULT_DIMENSION_SYMBOL_STYLE + SHOW_SELF_MARGINS_DIMENSIONS, + DEFAULT_DIMENSION_SYMBOL_STYLE } from '../../utils/default'; import { FindContainerById, MakeRecursionDFSIterator, Pairwise } from '../../utils/itertools'; import { TransformX, TransformY } from '../../utils/svg'; @@ -45,7 +46,7 @@ export function AddContainerDimensions( dimMapped, container.properties.dimensionOptions.selfMarginsDimensions.positions, AddHorizontalSelfMarginsDimension, - AddVerticalSelfMarginDimension, + AddVerticalSelfMarginsDimension, [ container, currentTransform, @@ -474,7 +475,6 @@ function AddHorizontalSelfMarginsDimension( yDim: number, container: IContainerModel, currentTransform: [number, number], - dimensions: React.ReactNode[], scale: number ): void { const style = container.properties.dimensionOptions.selfMarginsDimensions; @@ -520,7 +520,7 @@ function AddHorizontalSelfMarginsDimension( } } -function AddVerticalSelfMarginDimension( +function AddVerticalSelfMarginsDimension( ctx: CanvasRenderingContext2D, xDim: number, isRight: boolean, diff --git a/src/Components/SVG/Elements/DimensionLayer.tsx b/src/Components/SVG/Elements/DimensionLayer.tsx index 35ca740..8d62702 100644 --- a/src/Components/SVG/Elements/DimensionLayer.tsx +++ b/src/Components/SVG/Elements/DimensionLayer.tsx @@ -99,7 +99,7 @@ function Dimensions({ containers, symbols, root, scale }: IDimensionLayerProps): dimMapped, container.properties.dimensionOptions.selfMarginsDimensions.positions, AddHorizontalSelfMarginsDimension, - AddVerticalSelfMarginDimension, + AddVerticalSelfMarginsDimension, [ container, currentTransform, @@ -611,7 +611,7 @@ function AddHorizontalSelfMarginsDimension( } } -function AddVerticalSelfMarginDimension( +function AddVerticalSelfMarginsDimension( xDim: number, isRight: boolean, container: IContainerModel,