Skip to content

Commit 230f62e

Browse files
Rename calculateShapeAdjustedDimensions to calculateShapeAdjustedDimensionsBasedOnStrokeHeight and update imports
1 parent 19dc2a4 commit 230f62e

4 files changed

Lines changed: 29 additions & 23 deletions

File tree

src/common/components/mock-components/front-low-wireframes-components/circle-low-shape.tsx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import { ShapeSizeRestrictions, ShapeType } from '@/core/model';
22
import { forwardRef } from 'react';
33
import { ShapeProps } from '../shape.model';
4-
import { fitSizeToShapeSizeRestrictions } from '@/common/utils/shapes/shape-restrictions';
4+
import {
5+
fitSizeToShapeSizeRestrictions,
6+
calculateShapeAdjustedDimensionsBasedOnStrokeHeight,
7+
} from '@/common/utils/shapes';
58
import { Circle, Group } from 'react-konva';
69
import { useShapeProps } from '../../shapes/use-shape-props.hook';
710
import { BASIC_SHAPE } from '../front-components/shape.const';
811
import { useGroupShapeProps } from '../mock-components.utils';
9-
import { calculateShapeAdjustedDimensions } from '@/common/utils/shapes/shape-adjusted-dimensions';
1012

1113
const circleLowShapeRestrictions: ShapeSizeRestrictions = {
1214
minWidth: 10,
@@ -39,12 +41,13 @@ export const CircleLowShape = forwardRef<any, ShapeProps>((props, ref) => {
3941
BASIC_SHAPE
4042
);
4143

42-
const adjustedDimensions = calculateShapeAdjustedDimensions(
43-
strokeWidth,
44-
restrictedWidth,
45-
restrictedHeight,
46-
shapeType
47-
);
44+
const adjustedDimensions =
45+
calculateShapeAdjustedDimensionsBasedOnStrokeHeight(
46+
strokeWidth,
47+
restrictedWidth,
48+
restrictedHeight,
49+
shapeType
50+
);
4851

4952
const commonGroupProps = useGroupShapeProps(
5053
props,

src/common/components/mock-components/front-low-wireframes-components/ellipse-low-shape.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { ShapeProps } from '../shape.model';
66
import { useGroupShapeProps } from '../mock-components.utils';
77
import { BASIC_SHAPE } from '../front-components/shape.const';
88
import { useShapeProps } from '../../shapes/use-shape-props.hook';
9-
import { calculateShapeAdjustedDimensions } from '@/common/utils/shapes';
9+
import { calculateShapeAdjustedDimensionsBasedOnStrokeHeight } from '@/common/utils/shapes';
1010

1111
const EllipseLowShapeRestrictions: ShapeSizeRestrictions = {
1212
minWidth: 10,
@@ -47,12 +47,13 @@ export const EllipseLowShape = forwardRef<any, ShapeProps>((props, ref) => {
4747
BASIC_SHAPE
4848
);
4949

50-
const adjustedDimensions = calculateShapeAdjustedDimensions(
51-
strokeWidth,
52-
restrictedWidth,
53-
restrictedHeight,
54-
shapeType
55-
);
50+
const adjustedDimensions =
51+
calculateShapeAdjustedDimensionsBasedOnStrokeHeight(
52+
strokeWidth,
53+
restrictedWidth,
54+
restrictedHeight,
55+
shapeType
56+
);
5657

5758
const commonGroupProps = useGroupShapeProps(
5859
props,

src/common/components/mock-components/front-low-wireframes-components/rectangle-low-shape.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ShapeSizeRestrictions, ShapeType } from '@/core/model';
22
import { forwardRef } from 'react';
33
import { ShapeProps } from '../shape.model';
44
import {
5-
calculateShapeAdjustedDimensions,
5+
calculateShapeAdjustedDimensionsBasedOnStrokeHeight,
66
fitSizeToShapeSizeRestrictions,
77
} from '@/common/utils/shapes';
88
import { Group, Rect } from 'react-konva';
@@ -50,12 +50,13 @@ export const RectangleLowShape = forwardRef<any, ShapeProps>((props, ref) => {
5050
BASIC_SHAPE
5151
);
5252

53-
const adjustedDimensions = calculateShapeAdjustedDimensions(
54-
strokeWidth,
55-
restrictedWidth,
56-
restrictedHeight,
57-
shapeType
58-
);
53+
const adjustedDimensions =
54+
calculateShapeAdjustedDimensionsBasedOnStrokeHeight(
55+
strokeWidth,
56+
restrictedWidth,
57+
restrictedHeight,
58+
shapeType
59+
);
5960

6061
const commonGroupProps = useGroupShapeProps(
6162
props,

src/common/utils/shapes/shape-adjusted-dimensions.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { ShapeType } from '@/core/model';
22
import { AdjustedShapeDimensions } from './shape-dimension-types';
3-
export const calculateShapeAdjustedDimensions = (
3+
4+
export const calculateShapeAdjustedDimensionsBasedOnStrokeHeight = (
45
strokeWidth: number,
56
restrictedWidth: number,
67
restrictedHeight: number,

0 commit comments

Comments
 (0)