cleanup getMaxContainerHeight and getMaxContainerWidth and add specs

This commit is contained in:
Aakansha Doshi 2023-02-28 13:31:55 +05:30
parent 7722de4ef2
commit eacee9a158
4 changed files with 87 additions and 52 deletions

View file

@ -204,7 +204,10 @@ export const textWysiwyg = ({
}
maxWidth = getMaxContainerWidth(container);
maxHeight = getMaxContainerHeight(container);
maxHeight = getMaxContainerHeight(
container,
updatedTextElement as ExcalidrawTextElementWithContainer,
);
// autogrow container height if text exceeds
if (!isArrowElement(container) && textElementHeight > maxHeight) {