API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

I

interfaceCanvasSizingContext

@codexo/exojs / core / stable

What a CanvasSizing is given to work with, and the one channel through which it changes the canvas. A context describes the application as it stood when the policy was attached. The application hands out a fresh one on every attach, so a change it cannot express - a new base resolution, a canvas moved to another parent - reaches a policy by re-attaching it rather than by mutating what it already holds.

6
props
2
methods
0
events
Import
import { CanvasSizingContext } from '@codexo/exojs'

What a CanvasSizing is given to work with, and the one channel through which it changes the canvas.

A context describes the application as it stood when the policy was attached. The application hands out a fresh one on every attach, so a change it cannot express - a new base resolution, a canvas moved to another parent - reaches a policy by re-attaching it rather than by mutating what it already holds.

Methods2
Commit a new geometry. Resizes the backing store, writes the CSS box where one is requested, moves the application's logical coordinate system and dispatches Application.onResize. A commit whose logical or render size is not positive is ignored, so a policy may forward a zero-sized host measurement unconditionally.
Current size of CanvasSizingContext.host, or null when there is no host to measure. Reads layout, so call it once per change and pass the result on rather than measuring again downstream.
Properties6
baseHeight: number
Base (design) resolution the application was configured with.
baseWidth: number
Base (design) resolution the application was configured with.
element: HTMLCanvasElement | null
The surface as a document canvas, or null for an OffscreenCanvas.
host: HTMLElement | null
The canvas's parent element, or null when there is no document around it.
pixelRatio: number
Device pixels per CSS pixel the backing store is scaled by.
Source