diff --git a/src/Components/SVG/Elements/Dimension.tsx b/src/Components/SVG/Elements/Dimension.tsx index 08f0a22..c5f6f86 100644 --- a/src/Components/SVG/Elements/Dimension.tsx +++ b/src/Components/SVG/Elements/Dimension.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; +import { NOTCHES_LENGTH } from '../../../utils/default'; interface IDimensionProps { id: string @@ -38,15 +39,15 @@ export const Dimension: React.FC = (props: IDimensionProps) => const [perpVecX, perpVecY] = [unitY, -unitX]; // Use the parametric function to get the coordinates (x = x0 + t * v.x) - const startTopX = applyParametric(props.xStart, 4, perpVecX); - const startTopY = applyParametric(props.yStart, 4, perpVecY); - const startBottomX = applyParametric(props.xStart, -4, perpVecX); - const startBottomY = applyParametric(props.yStart, -4, perpVecY); + const startTopX = applyParametric(props.xStart, NOTCHES_LENGTH, perpVecX); + const startTopY = applyParametric(props.yStart, NOTCHES_LENGTH, perpVecY); + const startBottomX = applyParametric(props.xStart, -NOTCHES_LENGTH, perpVecX); + const startBottomY = applyParametric(props.yStart, -NOTCHES_LENGTH, perpVecY); - const endTopX = applyParametric(props.xEnd, 4, perpVecX); - const endTopY = applyParametric(props.yEnd, 4, perpVecY); - const endBottomX = applyParametric(props.xEnd, -4, perpVecX); - const endBottomY = applyParametric(props.yEnd, -4, perpVecY); + const endTopX = applyParametric(props.xEnd, NOTCHES_LENGTH, perpVecX); + const endTopY = applyParametric(props.yEnd, NOTCHES_LENGTH, perpVecY); + const endBottomX = applyParametric(props.xEnd, -NOTCHES_LENGTH, perpVecX); + const endBottomY = applyParametric(props.yEnd, -NOTCHES_LENGTH, perpVecY); return (