- pointScaler(reference?): ((a: Readonly<number | number[] | Point>, b?: number) => Readonly<{
x: number;
y: number;
}>) Returns ((a: Readonly<number | number[] | Point>, b?: number) => Readonly<{
x: number;
y: number;
}>)
- (a, b?): Readonly<{
x: number;
y: number;
}> Parameters
- a: Readonly<number | number[] | Point>
Optional
b: number
Returns Readonly<{
x: number;
y: number;
}>
Convert an absolute point to relative, in different coordinate spaces.
When calling the returned function, the input value must be in the same scale as the intended output scale.
Viewport-relative is used by default.
Example: Get relative position of click in screen coordinates
Example: Get relative position of click in viewport coordinates
Example: Get relative position of click in document coordinates