Import NOTCHES_LENGTH for the default value of the notches
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
8e41fdad46
commit
6c601429b9
1 changed files with 9 additions and 8 deletions
|
@ -1,4 +1,5 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
|
import { NOTCHES_LENGTH } from '../../../utils/default';
|
||||||
|
|
||||||
interface IDimensionProps {
|
interface IDimensionProps {
|
||||||
id: string
|
id: string
|
||||||
|
@ -38,15 +39,15 @@ export const Dimension: React.FC<IDimensionProps> = (props: IDimensionProps) =>
|
||||||
const [perpVecX, perpVecY] = [unitY, -unitX];
|
const [perpVecX, perpVecY] = [unitY, -unitX];
|
||||||
|
|
||||||
// Use the parametric function to get the coordinates (x = x0 + t * v.x)
|
// Use the parametric function to get the coordinates (x = x0 + t * v.x)
|
||||||
const startTopX = applyParametric(props.xStart, 4, perpVecX);
|
const startTopX = applyParametric(props.xStart, NOTCHES_LENGTH, perpVecX);
|
||||||
const startTopY = applyParametric(props.yStart, 4, perpVecY);
|
const startTopY = applyParametric(props.yStart, NOTCHES_LENGTH, perpVecY);
|
||||||
const startBottomX = applyParametric(props.xStart, -4, perpVecX);
|
const startBottomX = applyParametric(props.xStart, -NOTCHES_LENGTH, perpVecX);
|
||||||
const startBottomY = applyParametric(props.yStart, -4, perpVecY);
|
const startBottomY = applyParametric(props.yStart, -NOTCHES_LENGTH, perpVecY);
|
||||||
|
|
||||||
const endTopX = applyParametric(props.xEnd, 4, perpVecX);
|
const endTopX = applyParametric(props.xEnd, NOTCHES_LENGTH, perpVecX);
|
||||||
const endTopY = applyParametric(props.yEnd, 4, perpVecY);
|
const endTopY = applyParametric(props.yEnd, NOTCHES_LENGTH, perpVecY);
|
||||||
const endBottomX = applyParametric(props.xEnd, -4, perpVecX);
|
const endBottomX = applyParametric(props.xEnd, -NOTCHES_LENGTH, perpVecX);
|
||||||
const endBottomY = applyParametric(props.yEnd, -4, perpVecY);
|
const endBottomY = applyParametric(props.yEnd, -NOTCHES_LENGTH, perpVecY);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<g key={props.id}>
|
<g key={props.id}>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue