fix: update coords when text unbinded from its container (#6445)

* fix: update coords when text unbinded from its container

* Add specs
This commit is contained in:
Aakansha Doshi 2023-04-13 11:45:58 +05:30 committed by GitHub
parent 372743f59f
commit 13b27afe0f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 109 additions and 3 deletions

View file

@ -245,10 +245,16 @@ export const handleBindTextResize = (
}
};
const computeBoundTextPosition = (
export const computeBoundTextPosition = (
container: ExcalidrawElement,
boundTextElement: ExcalidrawTextElementWithContainer,
) => {
if (isArrowElement(container)) {
return LinearElementEditor.getBoundTextElementPosition(
container,
boundTextElement,
);
}
const containerCoords = getContainerCoords(container);
const maxContainerHeight = getMaxContainerHeight(container);
const maxContainerWidth = getMaxContainerWidth(container);