This commit is contained in:
Aakansha Doshi
2023-03-14 19:59:58 +05:30
parent 96c4cff805
commit 15f19835fe
7 changed files with 41 additions and 41 deletions

View File

@@ -45,7 +45,7 @@ import {
getBoundTextElementId,
getContainerElement,
handleBindTextResize,
getContainerMaxWidth,
getBoundTextMaxWidth,
} from "./textElement";
export const normalizeAngle = (angle: number): number => {
@@ -201,7 +201,7 @@ const measureFontSizeFromWidth = (
if (hasContainer) {
const container = getContainerElement(element);
if (container) {
width = getContainerMaxWidth(container);
width = getBoundTextMaxWidth(container);
}
}
const nextFontSize = element.fontSize * (nextWidth / width);
@@ -423,7 +423,7 @@ export const resizeSingleElement = (
const nextFontSize = measureFontSizeFromWidth(
boundTextElement,
getContainerMaxWidth(updatedElement),
getBoundTextMaxWidth(updatedElement),
);
if (nextFontSize === null) {
return;
@@ -694,7 +694,7 @@ const resizeMultipleElements = (
const fontSize = measureFontSizeFromWidth(
boundTextElement ?? (element.orig as ExcalidrawTextElement),
boundTextElement
? getContainerMaxWidth(updatedElement)
? getBoundTextMaxWidth(updatedElement)
: updatedElement.width,
);