DWVv0.37.0

CanvasSizeChecker

Source: generic.js:180

Canvas size checker: calls canCreateCanvas and caches its results. The browser canvas size limits do not change during a session, a size smaller than a valid one is valid and a size larger than an invalid one is invalid.

Meant to be shared by the view layers of a stage.


Constructor

new CanvasSizeChecker(): CanvasSizeChecker

Instance Methods

canCreate(size: Scalar2D, doc: Document): boolean

Test if a canvas with the input size can be created.

Parameters

  • size (Scalar2D) — The canvas size as {x,y}.
  • doc (Document) — The document used to create the test canvases.

Returns

  • boolean — True if the canvas can be created.