diff --git a/src/element/resizeElements.ts b/src/element/resizeElements.ts index 977fac964..9c47b57b8 100644 --- a/src/element/resizeElements.ts +++ b/src/element/resizeElements.ts @@ -551,7 +551,11 @@ export const resizeSingleElement = ( if (boundTextElement && boundTextFont) { mutateElement(boundTextElement, { fontSize: boundTextFont.fontSize }); } - handleBindTextResize(element, transformHandleDirection); + handleBindTextResize( + element, + transformHandleDirection, + shouldMaintainAspectRatio, + ); } }; diff --git a/src/element/textElement.ts b/src/element/textElement.ts index 4d9fa5eb5..37562ca9e 100644 --- a/src/element/textElement.ts +++ b/src/element/textElement.ts @@ -150,6 +150,7 @@ export const bindTextToShapeAfterDuplication = ( export const handleBindTextResize = ( container: NonDeletedExcalidrawElement, transformHandleType: MaybeTransformHandleType, + shouldMaintainAspectRatio = false, ) => { const boundTextElementId = getBoundTextElementId(container); if (!boundTextElementId) { @@ -174,7 +175,10 @@ export const handleBindTextResize = ( const maxWidth = getMaxContainerWidth(container); const maxHeight = getMaxContainerHeight(container); let containerHeight = containerDims.height; - if (transformHandleType !== "n" && transformHandleType !== "s") { + if ( + shouldMaintainAspectRatio || + (transformHandleType !== "n" && transformHandleType !== "s") + ) { if (text) { text = wrapText( textElement.originalText,