mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Move linear element handling out of App.tsx
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
This commit is contained in:
parent
c2b78346c1
commit
3068787ac4
4 changed files with 532 additions and 420 deletions
|
@ -6,7 +6,6 @@ import {
|
|||
invariant,
|
||||
isDevEnv,
|
||||
isTestEnv,
|
||||
toLocalPoint,
|
||||
} from "@excalidraw/common";
|
||||
|
||||
import {
|
||||
|
@ -527,14 +526,18 @@ export const bindLinearElement = (
|
|||
const points = Array.from(linearElement.points);
|
||||
|
||||
if (isArrowElement(linearElement)) {
|
||||
points[edgePointIndex] = toLocalPoint(
|
||||
bindPointToSnapToElementOutline(
|
||||
linearElement,
|
||||
hoveredElement,
|
||||
startOrEnd,
|
||||
elementsMap,
|
||||
),
|
||||
const [x, y] = bindPointToSnapToElementOutline(
|
||||
linearElement,
|
||||
hoveredElement,
|
||||
startOrEnd,
|
||||
elementsMap,
|
||||
);
|
||||
points[edgePointIndex] = LinearElementEditor.createPointAt(
|
||||
linearElement,
|
||||
elementsMap,
|
||||
x,
|
||||
y,
|
||||
null,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue