fix: cleanup getMaxContainerHeight and getMaxContainerWidth (#6519)

* fix: cleanup getMaxContainerHeight and getMaxContainerWidth

* rename getMaxContainerWidth -> getBoundTextMaxMaxWidth and getMaxContainerHeight -> getBoundTextMaxHeight

* add specs
This commit is contained in:
Aakansha Doshi 2023-04-25 18:06:23 +05:30 committed by GitHub
parent dae81c0a2c
commit da8dd389a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 96 additions and 56 deletions

View file

@ -33,7 +33,7 @@ import {
measureText,
normalizeText,
wrapText,
getMaxContainerWidth,
getBoundTextMaxWidth,
getDefaultLineHeight,
} from "./textElement";
import {
@ -310,7 +310,7 @@ export const refreshTextDimensions = (
text = wrapText(
text,
getFontString(textElement),
getMaxContainerWidth(container),
getBoundTextMaxWidth(container),
);
}
const dimensions = getAdjustedDimensions(textElement, text);