Skip to content

@ue-too/board / index / WorkerRelayCanvas

クラス: WorkerRelayCanvas ​

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

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:516

パラメータ ​

canvas ​

HTMLCanvasElement

webWorker ​

Worker

canvasDiemsionPublisher ​

CanvasPositionDimensionPublisher

戻り値 ​

WorkerRelayCanvas

アクセッサー ​

detached ​

署名を取得する ​

get detached(): boolean

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

Whether the canvas is currently detached from the DOM

戻り値 ​

boolean

Whether the canvas is currently detached from the DOM

の実装 ​

Canvas.detached


dimensions ​

署名を取得する ​

get dimensions(): object

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

Combined dimensions and position information

戻り値 ​

object

height ​

height: number

position ​

position: Point

width ​

width: number

Combined dimensions and position information

の実装 ​

Canvas.dimensions


height ​

署名を取得する ​

get height(): number

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

The canvas height in CSS pixels

戻り値 ​

number

The canvas height in CSS pixels

の実装 ​

Canvas.height


position ​

署名を取得する ​

get position(): Point

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

The top-left position of the canvas in window coordinates

戻り値 ​

Point

The top-left position of the canvas in window coordinates

の実装 ​

Canvas.position


width ​

署名を取得する ​

get width(): number

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

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:579

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:559

Cleanup method to dispose of resources and event listeners

戻り値 ​

void

の実装 ​

Canvas.tearDown