fix: Arrow endpoint offset (#10706)

Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
This commit is contained in:
Márk Tolmács
2026-01-26 20:55:08 +01:00
committed by GitHub
parent 54fa0c9089
commit 6a891365b9
2 changed files with 7 additions and 4 deletions
@@ -724,7 +724,6 @@ export class LinearElementEditor {
? [pointerDownState.lastClickedPoint]
: selectedPointsIndices,
isDragging: false,
pointerOffset: { x: 0, y: 0 },
customLineAngle: null,
initialState: {
...editingLinearElement.initialState,
@@ -98,7 +98,10 @@ export const actionFinalize = register<FormData>({
map.set(index, {
point: LinearElementEditor.pointFromAbsoluteCoords(
element,
pointFrom<GlobalPoint>(sceneCoords.x, sceneCoords.y),
pointFrom<GlobalPoint>(
sceneCoords.x - linearElementEditor.pointerOffset.x,
sceneCoords.y - linearElementEditor.pointerOffset.y,
),
elementsMap,
),
});
@@ -109,8 +112,8 @@ export const actionFinalize = register<FormData>({
bindOrUnbindBindingElement(
element,
draggedPoints,
sceneCoords.x,
sceneCoords.y,
sceneCoords.x - linearElementEditor.pointerOffset.x,
sceneCoords.y - linearElementEditor.pointerOffset.y,
scene,
appState,
{
@@ -173,6 +176,7 @@ export const actionFinalize = register<FormData>({
...linearElementEditor.initialState,
lastClickedPoint: -1,
},
pointerOffset: { x: 0, y: 0 },
},
selectionElement: null,
suggestedBinding: null,