Skip to content
您正在瀏覽 v0.18 的文件。最新版本為 v0.20。 前往最新文件

@ue-too/board / index / WorkerRelayCanvas

類別: WorkerRelayCanvas ​

定義於: packages/board/src/input-interpretation/input-state-machine/kmt-input-context.ts:481

Description ​

A proxy for the canvas that is used to communicate with the web worker. The primary purpose of this class is to cache the canvas dimensions and position in the DOM to reduce the calling of the getBoundingClientRect method. This class only serves as a relay of the updated canvas dimensions and position to the web worker.

實作 ​

建構函式 ​

建構函式 ​

new WorkerRelayCanvas(canvas, webWorker, canvasDiemsionPublisher): WorkerRelayCanvas

定義於: packages/board/src/input-interpretation/input-state-machine/kmt-input-context.ts:489

參數 ​

canvas ​

HTMLCanvasElement

webWorker ​

Worker

canvasDiemsionPublisher ​

CanvasPositionDimensionPublisher

回傳 ​

WorkerRelayCanvas

存取器 ​

detached ​

Getter 簽章 ​

get detached(): boolean

定義於: packages/board/src/input-interpretation/input-state-machine/kmt-input-context.ts:548

Whether the canvas is currently detached from the DOM

回傳 ​

boolean

Whether the canvas is currently detached from the DOM

實作了 ​

Canvas.detached


dimensions ​

Getter 簽章 ​

get dimensions(): object

定義於: packages/board/src/input-interpretation/input-state-machine/kmt-input-context.ts:540

Combined dimensions and position information

回傳 ​

object

height ​

height: number

position ​

position: Point

width ​

width: number

Combined dimensions and position information

實作了 ​

Canvas.dimensions


height ​

Getter 簽章 ​

get height(): number

定義於: packages/board/src/input-interpretation/input-state-machine/kmt-input-context.ts:528

The canvas height in CSS pixels

回傳 ​

number

The canvas height in CSS pixels

實作了 ​

Canvas.height


position ​

Getter 簽章 ​

get position(): Point

定義於: packages/board/src/input-interpretation/input-state-machine/kmt-input-context.ts:536

The top-left position of the canvas in window coordinates

回傳 ​

Point

The top-left position of the canvas in window coordinates

實作了 ​

Canvas.position


width ​

Getter 簽章 ​

get width(): number

定義於: packages/board/src/input-interpretation/input-state-machine/kmt-input-context.ts:524

The canvas width in CSS pixels

回傳 ​

number

The canvas width in CSS pixels

實作了 ​

Canvas.width

方法 ​

setCursor() ​

setCursor(style): void

定義於: packages/board/src/input-interpretation/input-state-machine/kmt-input-context.ts:552

Sets the CSS cursor style for visual feedback

參數 ​

style ​

"grab" | "default" | "grabbing"

回傳 ​

void

實作了 ​

Canvas.setCursor


tearDown() ​

tearDown(): void

定義於: packages/board/src/input-interpretation/input-state-machine/kmt-input-context.ts:532

Cleanup method to dispose of resources and event listeners

回傳 ​

void

實作了 ​

Canvas.tearDown