fix: use canvas height when editing bound text

This commit is contained in:
Aakansha Doshi 2023-02-27 14:19:56 +05:30
parent 0e95e2b386
commit 60deddb0e2
2 changed files with 21 additions and 28 deletions

View file

@ -226,7 +226,7 @@ export const handleBindTextResize = (
}
};
const computeBoundTextPosition = (
export const computeBoundTextPosition = (
container: ExcalidrawElement,
boundTextElement: ExcalidrawTextElementWithContainer,
) => {
@ -236,6 +236,12 @@ const computeBoundTextPosition = (
let x;
let y;
if (isArrowElement(container)) {
return LinearElementEditor.getBoundTextElementPosition(
container,
boundTextElement,
);
}
if (boundTextElement.verticalAlign === VERTICAL_ALIGN.TOP) {
y = containerCoords.y;
} else if (boundTextElement.verticalAlign === VERTICAL_ALIGN.BOTTOM) {