Reference · Framing, geometry and quiz tools
applyInsetTransformfunction
The same move, applied to a point: a centroid, so a handle follows its region.
Import it
import { applyInsetTransform } from "@johnmorrisdotca/chizu";
Definition
function applyInsetTransform(point: readonly [number, number], transform: InsetTransform): [number, number]
Parameters
| Name | Type | Description |
|---|---|---|
point | readonly [number, number] | The point in native canvas coordinates. |
transform | InsetTransform | The native inset scale and translation to apply. |
Returns
[number, number]
The same move, applied to a point: a centroid, so a handle follows its region.
Examples
import { applyInsetTransform } from "@johnmorrisdotca/chizu";
console.log(applyInsetTransform([100, 40], { scale: 0.5, x: 10, y: 20 }));
// [ 60, 40 ][ 60, 40 ]What it prints (run when this page was built)