Binding tests updated

This commit is contained in:
Mark Tolmacs
2025-08-14 15:45:22 +02:00
parent bc98061d2d
commit 79a69b0db7
3 changed files with 676 additions and 697 deletions

View File

@@ -408,19 +408,13 @@ const bindingStrategyForNewSimpleArrowEndpointDragging = (
const otherIsInsideBinding =
!!appState.selectedLinearElement?.pointerDownState.arrowStartIsInside;
// We need to "jump" the start point out with the detached
// focus point of the center of the bound element
invariant(
arrowOriginalStartPoint,
"Arrow original start point must be defined",
);
const other: BindingStrategy = {
mode: otherIsInsideBinding ? "inside" : "orbit",
element: otherElement,
focusPoint: snapToCenter(
otherElement,
elementsMap,
arrowOriginalStartPoint,
arrowOriginalStartPoint ?? pointFrom<GlobalPoint>(arrow.x, arrow.y),
),
};

View File

@@ -222,7 +222,19 @@ const rotateSingleElement = (
}
const boundTextElementId = getBoundTextElementId(element);
scene.mutateElement(element, { angle });
let update: ElementUpdate<NonDeletedExcalidrawElement> = {
angle,
};
if (isBindingElement(element)) {
update = {
...update,
startBinding: null,
endBinding: null,
} as ElementUpdate<ExcalidrawArrowElement>;
}
scene.mutateElement(element, update);
if (boundTextElementId) {
const textElement =
scene.getElement<ExcalidrawTextElementWithContainer>(boundTextElementId);

File diff suppressed because it is too large Load Diff