fix: False binding

Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
This commit is contained in:
Mark Tolmacs
2026-03-18 16:29:09 +00:00
parent ba087233cb
commit 9fd91d9a59
+2 -19
View File
@@ -17,7 +17,6 @@ import {
import {
KEYS,
arrayToMap,
getGridPoint,
invariant,
shouldRotateWithDiscreteAngle,
updateActiveTool,
@@ -116,27 +115,11 @@ export const actionFinalize = register<FormData>({
return map;
}, new Map()) ?? new Map();
const startIsDragged = selectedPointsIndices.includes(0);
const lockedGlobal = angleLocked
? LinearElementEditor.getPointAtIndexGlobalCoordinates(
element,
startIsDragged ? 0 : -1,
elementsMap,
)
: null;
const [gridSnappedX, gridSnappedY] = getGridPoint(
sceneCoords.x - linearElementEditor.pointerOffset.x,
sceneCoords.y - linearElementEditor.pointerOffset.y,
effectiveGridSize,
);
const bindingSceneX = lockedGlobal ? lockedGlobal[0] : gridSnappedX;
const bindingSceneY = lockedGlobal ? lockedGlobal[1] : gridSnappedY;
bindOrUnbindBindingElement(
element,
draggedPoints,
bindingSceneX,
bindingSceneY,
sceneCoords.x,
sceneCoords.y,
scene,
appState,
{