zoomedAboutfunction
A view zoomed by factor about the point (px, py) of the box, which stays over the same spot of the board.
Import it
import { zoomedAbout } from "@johnmorrisdotca/tsunagi/play";
Definition
function zoomedAbout(view: TsunagiView, factor: number, px: number, py: number, box: number): TsunagiView
Parameters
| Name | Type | Description |
|---|---|---|
view | TsunagiView | The current zoom and pixel translation. |
factor | number | The positive zoom scale. |
px | number | The horizontal pointer position in pixels. |
py | number | The vertical pointer position in pixels. |
box | number | The available square view size or edge bounds. |
Returns
TsunagiView
A view zoomed by factor about the point (px, py) of the box, which stays over the same spot of the board.
Examples
import { zoomedAbout } from "@johnmorrisdotca/tsunagi/play";
console.log(zoomedAbout({zoom:1,x:0,y:0},1.2,320,240,640));{ zoom: 1.2, x: -64, y: -48 }What it prints (run when this page was built)