mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-08-24 10:47:31 +02:00
Binding tests updated
This commit is contained in:
@@ -408,19 +408,13 @@ const bindingStrategyForNewSimpleArrowEndpointDragging = (
|
|||||||
const otherIsInsideBinding =
|
const otherIsInsideBinding =
|
||||||
!!appState.selectedLinearElement?.pointerDownState.arrowStartIsInside;
|
!!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 = {
|
const other: BindingStrategy = {
|
||||||
mode: otherIsInsideBinding ? "inside" : "orbit",
|
mode: otherIsInsideBinding ? "inside" : "orbit",
|
||||||
element: otherElement,
|
element: otherElement,
|
||||||
focusPoint: snapToCenter(
|
focusPoint: snapToCenter(
|
||||||
otherElement,
|
otherElement,
|
||||||
elementsMap,
|
elementsMap,
|
||||||
arrowOriginalStartPoint,
|
arrowOriginalStartPoint ?? pointFrom<GlobalPoint>(arrow.x, arrow.y),
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -222,7 +222,19 @@ const rotateSingleElement = (
|
|||||||
}
|
}
|
||||||
const boundTextElementId = getBoundTextElementId(element);
|
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) {
|
if (boundTextElementId) {
|
||||||
const textElement =
|
const textElement =
|
||||||
scene.getElement<ExcalidrawTextElementWithContainer>(boundTextElementId);
|
scene.getElement<ExcalidrawTextElementWithContainer>(boundTextElementId);
|
||||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user