Type Alias Scaler

Scaler: ((a: number | Point, b?: number | Rect, c?: number | Rect, d?: number) => Point)

A scale function that takes an input value to scale. Input can be in the form of { x, y } or two number parameters.

scale(10, 20);
scale({ x:10, y:20 });

Output range can be specified as a { width, height } or two number parameters. If omitted, the default range is used.

// Scale 10,20 with range w:800 h:600
scale(10, 20, 800, 600);
scale({x:10, y:20}, 800, 600);
scale({x:10, y:20}, {width: 800, height: 600});