include arrowhead in detection (wip)

This commit is contained in:
Ryan Di 2025-01-10 19:23:08 +11:00
parent 49fbad32ac
commit 4672bb948c
5 changed files with 122 additions and 57 deletions

View file

@ -73,7 +73,7 @@ export type Ellipse<Point extends GlobalPoint | LocalPoint> = {
halfHeight: number;
};
export type GeometricShape<Point extends GlobalPoint | LocalPoint> =
export type GeometricShape<Point extends GlobalPoint | LocalPoint> = (
| {
type: "line";
data: LineSegment<Point>;
@ -97,7 +97,10 @@ export type GeometricShape<Point extends GlobalPoint | LocalPoint> =
| {
type: "polycurve";
data: Polycurve<Point>;
};
}
) & {
isClosed?: boolean;
};
type RectangularElement =
| ExcalidrawRectangleElement
@ -203,9 +206,9 @@ export const getCurvePathOps = (shape: Drawable): Op[] => {
// linear
export const getCurveShape = <Point extends GlobalPoint | LocalPoint>(
roughShape: Drawable,
startingPoint: Point = pointFrom(0, 0),
angleInRadian: Radians,
center: Point,
startingPoint: Point = pointFrom(0, 0),
): GeometricShape<Point> => {
const transform = (p: Point): Point =>
pointRotateRads(