Move linear element handling out of App.tsx

Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
This commit is contained in:
Mark Tolmacs 2025-04-08 13:44:54 +02:00
parent c2b78346c1
commit 3068787ac4
No known key found for this signature in database
4 changed files with 532 additions and 420 deletions

View file

@ -1,14 +1,7 @@
import {
average,
type GlobalPoint,
type LocalPoint,
pointTranslate,
vector,
} from "@excalidraw/math";
import { average } from "@excalidraw/math";
import type {
ExcalidrawBindableElement,
ExcalidrawElement,
FontFamilyValues,
FontString,
} from "@excalidraw/element/types";
@ -1208,6 +1201,3 @@ export const escapeDoubleQuotes = (str: string) => {
export const castArray = <T>(value: T | T[]): T[] =>
Array.isArray(value) ? value : [value];
export const toLocalPoint = (p: GlobalPoint, element: ExcalidrawElement) =>
pointTranslate<GlobalPoint, LocalPoint>(p, vector(-element.x, -element.y));