New simple arrows stick to outline as well

This commit is contained in:
Mark Tolmacs
2025-03-02 18:22:45 +01:00
parent 2f02d72741
commit 373b940e75
2 changed files with 57 additions and 25 deletions

View File

@@ -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 },