Skip to content

vyaz-monorepo / core/src / applyScale

Function: applyScale() ​

applyScale(doc, scale): TextFrame

Defined in: core/src/layout/AutoFitEngine.ts:37

Apply a scale factor to all fontSize values in the document. inlineWidget dimensions are NOT scaled. Returns a NEW document (does not mutate the original).

Sizes are rounded to two decimals — what a caller re-deriving the size from scale would get. Autofit measures through applyScaleExact instead: see there for why the rounded size is the wrong one to measure.

Parameters ​

doc ​

TextFrame

scale ​

number

Returns ​

TextFrame

Released under the MIT License.