Import NOTCHES_LENGTH for the default value of the notches
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Hydroxycarbamide 2022-08-11 23:45:16 +02:00
parent 8e41fdad46
commit 6c601429b9

View file

@ -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<IDimensionProps> = (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 (
<g key={props.id}>