keptViewfunction
A view kept inside the board: never a gap between the board's edge and the box's. box is the box's width in pixels.
Import it
import { keptView } from "@johnmorrisdotca/tsunagi/play";
Definition
function keptView(view: TsunagiView, box: number): TsunagiView
Parameters
| Name | Type | Description |
|---|---|---|
view | TsunagiView | The current zoom and pixel translation. |
box | number | The available square view size or edge bounds. |
Returns
TsunagiView
A view kept inside the board: never a gap between the board's edge and the box's. box is the box's width in pixels.
Examples
import { keptView } from "@johnmorrisdotca/tsunagi/play";
console.log(keptView({zoom:1,x:0,y:0},640));{ zoom: 1, x: 0, y: 0 }What it prints (run when this page was built)