mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-19 07:20:21 +02:00
Move linear element handling out of App.tsx
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
This commit is contained in:
@@ -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,
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user