From cc01e16e52fd04d5edb7025714238d3746c13e26 Mon Sep 17 00:00:00 2001 From: Mark Tolmacs Date: Mon, 7 Apr 2025 10:25:00 +0200 Subject: [PATCH] Attempt at moving the initial point when inside shape Signed-off-by: Mark Tolmacs --- packages/excalidraw/components/App.tsx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/packages/excalidraw/components/App.tsx b/packages/excalidraw/components/App.tsx index 2961af31f1..01726b158e 100644 --- a/packages/excalidraw/components/App.tsx +++ b/packages/excalidraw/components/App.tsx @@ -8772,6 +8772,25 @@ class App extends React.Component { false, { isDragging: true }, ); + LinearElementEditor.movePoints(newElement, [ + { + index: 0, + isDragging: false, + point: toLocalPoint( + getOutlineAvoidingPoint( + newElement, + pointFrom( + pointerDownState.origin.x, + pointerDownState.origin.y, + ), + 0, + this.scene, + this.state.zoom, + ), + newElement, + ), + }, + ]); } this.setState({