nearestWrappedBox関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The copy of a window nearest another one. Travelling from Japan to Hawaii is a short hop east across the date line, and their stored coordinates are at opposite ends of the canvas, so easing between the two as they are stored sweeps the whole earth the wrong way. Sliding the destination onto the nearest copy makes the journey the short one.
インポート
import { nearestWrappedBox } from "@johnmorrisdotca/chizu";
定義
function nearestWrappedBox(from: MapBox, to: MapBox, width: number): MapBox
引数
| 名前 | 型 | 説明 |
|---|---|---|
from | MapBox | The starting window in native map units. |
to | MapBox | The destination window whose nearest wrapped copy is requested. |
width | number | The native canvas width or frame width specified by this signature. |
戻り値
MapBox
The copy of a window nearest another one. Travelling from Japan to Hawaii is a short hop east across the date line, and their stored coordinates are at opposite ends of the canvas, so easing between the two as they are stored sweeps the whole earth the wrong way. Sliding the destination onto the nearest copy makes the journey the short one.
例
import { nearestWrappedBox } from "@johnmorrisdotca/chizu";
console.log(nearestWrappedBox({ x: -50, y: 0, width: 100, height: 100 }, { x: 900, y: 0, width: 100, height: 100 }, 1000));
// { x: -100, y: 0, width: 100, height: 100 }{ x: -100, y: 0, width: 100, height: 100 }出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。