fix: bound arrows not updated when rotating multiple elements (#6662)
This commit is contained in:
parent
a39640ead1
commit
b4abfad638
@ -890,26 +890,34 @@ const rotateMultipleElements = (
|
|||||||
centerY,
|
centerY,
|
||||||
centerAngle + origAngle - element.angle,
|
centerAngle + origAngle - element.angle,
|
||||||
);
|
);
|
||||||
mutateElement(element, {
|
|
||||||
x: element.x + (rotatedCX - cx),
|
mutateElement(
|
||||||
y: element.y + (rotatedCY - cy),
|
element,
|
||||||
angle: normalizeAngle(centerAngle + origAngle),
|
{
|
||||||
});
|
x: element.x + (rotatedCX - cx),
|
||||||
const boundTextElementId = getBoundTextElementId(element);
|
y: element.y + (rotatedCY - cy),
|
||||||
if (boundTextElementId) {
|
angle: normalizeAngle(centerAngle + origAngle),
|
||||||
const textElement =
|
},
|
||||||
Scene.getScene(element)?.getElement<ExcalidrawTextElementWithContainer>(
|
false,
|
||||||
boundTextElementId,
|
);
|
||||||
);
|
|
||||||
if (textElement && !isArrowElement(element)) {
|
updateBoundElements(element, { simultaneouslyUpdated: elements });
|
||||||
mutateElement(textElement, {
|
|
||||||
x: textElement.x + (rotatedCX - cx),
|
const boundText = getBoundTextElement(element);
|
||||||
y: textElement.y + (rotatedCY - cy),
|
if (boundText && !isArrowElement(element)) {
|
||||||
|
mutateElement(
|
||||||
|
boundText,
|
||||||
|
{
|
||||||
|
x: boundText.x + (rotatedCX - cx),
|
||||||
|
y: boundText.y + (rotatedCY - cy),
|
||||||
angle: normalizeAngle(centerAngle + origAngle),
|
angle: normalizeAngle(centerAngle + origAngle),
|
||||||
});
|
},
|
||||||
}
|
false,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Scene.getScene(elements[0])?.informMutation();
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getResizeOffsetXY = (
|
export const getResizeOffsetXY = (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user