@ue-too/board / WorkerRelayCanvas
Class: WorkerRelayCanvas
Defined in: packages/board/src/input-interpretation/input-state-machine/kmt-input-context.ts:507
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.
Implements
Constructors
Constructor
new WorkerRelayCanvas(
canvas,webWorker,canvasDiemsionPublisher):WorkerRelayCanvas
Defined in: packages/board/src/input-interpretation/input-state-machine/kmt-input-context.ts:515
Parameters
canvas
HTMLCanvasElement
webWorker
Worker
canvasDiemsionPublisher
CanvasPositionDimensionPublisher
Returns
WorkerRelayCanvas
Accessors
detached
Get Signature
get detached():
boolean
Defined in: packages/board/src/input-interpretation/input-state-machine/kmt-input-context.ts:574
Whether the canvas is currently detached from the DOM
Returns
boolean
Whether the canvas is currently detached from the DOM
Implementation of
dimensions
Get Signature
get dimensions():
object
Defined in: packages/board/src/input-interpretation/input-state-machine/kmt-input-context.ts:566
Combined dimensions and position information
Returns
object
height
height:
number
position
position:
Point
width
width:
number
Combined dimensions and position information
Implementation of
height
Get Signature
get height():
number
Defined in: packages/board/src/input-interpretation/input-state-machine/kmt-input-context.ts:554
The canvas height in CSS pixels
Returns
number
The canvas height in CSS pixels
Implementation of
position
Get Signature
get position():
Point
Defined in: packages/board/src/input-interpretation/input-state-machine/kmt-input-context.ts:562
The top-left position of the canvas in window coordinates
Returns
Point
The top-left position of the canvas in window coordinates
Implementation of
width
Get Signature
get width():
number
Defined in: packages/board/src/input-interpretation/input-state-machine/kmt-input-context.ts:550
The canvas width in CSS pixels
Returns
number
The canvas width in CSS pixels
Implementation of
Methods
setCursor()
setCursor(
style):void
Defined in: packages/board/src/input-interpretation/input-state-machine/kmt-input-context.ts:578
Sets the CSS cursor style for visual feedback
Parameters
style
"grab" | "default" | "grabbing"
Returns
void
Implementation of
tearDown()
tearDown():
void
Defined in: packages/board/src/input-interpretation/input-state-machine/kmt-input-context.ts:558
Cleanup method to dispose of resources and event listeners
Returns
void