Skip to main content

Class: HorizonCanvasLayerCanvasInstanceClass

Defined in: src/sdk/components/horizon/layers/HorizonCanvasLayer.tsx:42

An implementation of MapCanvasLayerCanvasInstance.

Implements

Constructors

Constructor

new HorizonCanvasLayerCanvasInstanceClass(canvas, context, isDisplayed): HorizonCanvasLayerCanvasInstanceClass

Defined in: src/sdk/components/horizon/layers/HorizonCanvasLayer.tsx:49

Creates a new canvas instance.

Parameters

ParameterTypeDescription
canvasHTMLCanvasElementThe canvas element.
contextCanvasRenderingContext2DThe canvas 2D rendering context.
isDisplayedbooleanWhether the canvas is displayed.

Returns

HorizonCanvasLayerCanvasInstanceClass

Properties

canvas

readonly canvas: HTMLCanvasElement

Defined in: src/sdk/components/horizon/layers/HorizonCanvasLayer.tsx:50

The canvas element.

Implementation of

HorizonCanvasLayerCanvasInstance.canvas


context

readonly context: CanvasRenderingContext2D

Defined in: src/sdk/components/horizon/layers/HorizonCanvasLayer.tsx:51

The canvas 2D rendering context.

Implementation of

HorizonCanvasLayerCanvasInstance.context


isDisplayed

readonly isDisplayed: boolean

Defined in: src/sdk/components/horizon/layers/HorizonCanvasLayer.tsx:52

Whether the canvas is displayed.

Implementation of

HorizonCanvasLayerCanvasInstance.isDisplayed

Methods

clear()

clear(): void

Defined in: src/sdk/components/horizon/layers/HorizonCanvasLayer.tsx:57

Clears this canvas.

Returns

void

Implementation of

HorizonCanvasLayerCanvasInstance.clear


reset()

reset(): void

Defined in: src/sdk/components/horizon/layers/HorizonCanvasLayer.tsx:62

Resets this instance's canvas. This will erase the canvas of all drawn pixels, reset its state (including all styles, transformations, and cached paths), and clear the Coherent GT command buffer associated with it.

Returns

void

Implementation of

HorizonCanvasLayerCanvasInstance.reset