Skip to content

@fabwcie/free-drawing / utils/text / fitTextWidth

Function: fitTextWidth() ​

fitTextWidth(text): boolean

Defined in: packages/free-drawing/src/utils/text.ts:36

Fit width of a text to its content (lines no longer wrapped), its lines stay in place whatever their alignment

Parameters ​

text ​

Text

text node to resize (moved along its x axis for center or right alignment)

Returns ​

boolean

true if width changed