fix ts
This commit is contained in:
@@ -37,6 +37,7 @@ import {
|
|||||||
type GlobalPoint,
|
type GlobalPoint,
|
||||||
type LocalPoint,
|
type LocalPoint,
|
||||||
type LineSegment,
|
type LineSegment,
|
||||||
|
type Radians,
|
||||||
} from "@excalidraw/math";
|
} from "@excalidraw/math";
|
||||||
import { isCurve } from "@excalidraw/math/curve";
|
import { isCurve } from "@excalidraw/math/curve";
|
||||||
|
|
||||||
@@ -52,6 +53,7 @@ import type {
|
|||||||
ExcalidrawArrowElement,
|
ExcalidrawArrowElement,
|
||||||
ExcalidrawBindableElement,
|
ExcalidrawBindableElement,
|
||||||
FixedPointBinding,
|
FixedPointBinding,
|
||||||
|
Ordered,
|
||||||
OrderedExcalidrawElement,
|
OrderedExcalidrawElement,
|
||||||
} from "@excalidraw/element/types";
|
} from "@excalidraw/element/types";
|
||||||
import type { SimpleArrowCurveDebugData } from "@excalidraw/element";
|
import type { SimpleArrowCurveDebugData } from "@excalidraw/element";
|
||||||
@@ -133,7 +135,7 @@ const getSimpleArrowTransform = (
|
|||||||
const rotated = pointRotateRads(
|
const rotated = pointRotateRads(
|
||||||
pointFrom<GlobalPoint>(vector[0], vector[1]),
|
pointFrom<GlobalPoint>(vector[0], vector[1]),
|
||||||
pointFrom<GlobalPoint>(0, 0),
|
pointFrom<GlobalPoint>(0, 0),
|
||||||
-element.angle,
|
-element.angle as Radians,
|
||||||
);
|
);
|
||||||
|
|
||||||
return [rotated[0], rotated[1]];
|
return [rotated[0], rotated[1]];
|
||||||
@@ -146,7 +148,7 @@ const getSimpleArrowDebugStateForElement = (
|
|||||||
elementId: string,
|
elementId: string,
|
||||||
): SelectedSimpleArrowDebugState | null => {
|
): SelectedSimpleArrowDebugState | null => {
|
||||||
const element = elements.find(
|
const element = elements.find(
|
||||||
(candidate): candidate is ExcalidrawArrowElement =>
|
(candidate): candidate is Ordered<ExcalidrawArrowElement> =>
|
||||||
candidate.id === elementId &&
|
candidate.id === elementId &&
|
||||||
!candidate.isDeleted &&
|
!candidate.isDeleted &&
|
||||||
isArrowElement(candidate) &&
|
isArrowElement(candidate) &&
|
||||||
@@ -1059,7 +1061,7 @@ const DebugCanvas = React.forwardRef<HTMLCanvasElement, DebugCanvasProps>(
|
|||||||
const nextElements =
|
const nextElements =
|
||||||
excalidrawAPI.getSceneElements() as OrderedExcalidrawElement[];
|
excalidrawAPI.getSceneElements() as OrderedExcalidrawElement[];
|
||||||
const element = nextElements.find(
|
const element = nextElements.find(
|
||||||
(candidate): candidate is ExcalidrawArrowElement =>
|
(candidate): candidate is Ordered<ExcalidrawArrowElement> =>
|
||||||
candidate.id === handle.elementId &&
|
candidate.id === handle.elementId &&
|
||||||
!candidate.isDeleted &&
|
!candidate.isDeleted &&
|
||||||
isArrowElement(candidate),
|
isArrowElement(candidate),
|
||||||
|
|||||||
Reference in New Issue
Block a user