mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-11-20 12:44:38 +01:00
New simple arrows stick to outline as well
This commit is contained in:
@@ -8683,10 +8683,22 @@ class App extends React.Component<AppProps, AppState> {
|
||||
points.length === 2 ||
|
||||
(points.length > 1 && isElbowArrow(newElement))
|
||||
) {
|
||||
const globalPoint = LinearElementEditor.getOutlineAvoidingPoint(
|
||||
newElement,
|
||||
{ x: newElement.x + dx, y: newElement.y + dy },
|
||||
1,
|
||||
this,
|
||||
);
|
||||
mutateElement(
|
||||
newElement,
|
||||
{
|
||||
points: [...points.slice(0, -1), pointFrom<LocalPoint>(dx, dy)],
|
||||
points: [
|
||||
...points.slice(0, -1),
|
||||
pointFrom<LocalPoint>(
|
||||
globalPoint[0] - newElement.x,
|
||||
globalPoint[1] - newElement.y,
|
||||
),
|
||||
],
|
||||
},
|
||||
false,
|
||||
{ isDragging: true },
|
||||
|
||||
Reference in New Issue
Block a user