Skip to main content

Function: scale()

scale(sx, sy?): Affine

Defined in: affine.ts:57

Create a scaling transform from a scalar or vector.

You can pass either one or two scaling factors. Passing only a single scalar value will scale in both dimensions equally. A vector scaling value scales the dimensions independently.

Parameters

sx

number

Scaling factor in x direction.

sy?

number = sx

Scaling factor in y direction (defaults to sx if not provided).

Returns

Affine

Transform that applies the given scaling.