mirror of
https://github.com/projectstorm/react-diagrams.git
synced 2025-08-17 18:53:37 +08:00
Use existing PointModel instead of new Point interface
This commit is contained in:
@ -16,17 +16,12 @@ export interface DefaultLinkState {
|
|||||||
selected: boolean;
|
selected: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Point {
|
const linePath = (firstPoint: PointModel, lastPoint: PointModel): string =>
|
||||||
x: number;
|
|
||||||
y: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
const linePath = (firstPoint: Point, lastPoint: Point): string =>
|
|
||||||
`M${firstPoint.x},${firstPoint.y} L ${lastPoint.x},${lastPoint.y}`;
|
`M${firstPoint.x},${firstPoint.y} L ${lastPoint.x},${lastPoint.y}`;
|
||||||
|
|
||||||
const curvePath = (
|
const curvePath = (
|
||||||
firstPoint: Point,
|
firstPoint: PointModel,
|
||||||
lastPoint: Point,
|
lastPoint: PointModel,
|
||||||
firstPointDelta: number = 0,
|
firstPointDelta: number = 0,
|
||||||
lastPointDelta: number = 0
|
lastPointDelta: number = 0
|
||||||
): string =>
|
): string =>
|
||||||
|
Reference in New Issue
Block a user