Reference · Rules, tiles and records
zoomViewfunction
Zoomed by factor about the point (px, py) on the screen, which stays over the same spot of the table.
Import it
import { zoomView } from "@johnmorrisdotca/kumimoji";
Definition
function zoomView(view: View, factor: number, px: number, py: number): View
Parameters
| Name | Type | Description |
|---|---|---|
view | View | The current tile size and pixel translation. |
factor | number | The positive scale factor for zooming. |
px | number | The horizontal pointer position in pixels. |
py | number | The vertical pointer position in pixels. |
Returns
View
Zoomed by factor about the point (px, py) on the screen, which stays over the same spot of the table.
Examples
import { zoomView } from "@johnmorrisdotca/kumimoji";
const view = {tile:40,x:100,y:100};
console.log(zoomView(view,1.2,320,240));{ tile: 48, x: 56, y: 72 }What it prints (run when this page was built)