Function fullSizeCanvas

Resizes given canvas element to match window size. To resize canvas to match its parent, use parentSizeCanvas.

To make the canvas appear propery, it sets the following CSS:

{
top: 0;
left: 0;
zIndex: -1;
position: fixed;
}

Pass true for skipCss to avoid this.

Provide a callback for when resize happens.

  • Parameters

    • domQueryOrEl: Readonly<
          | undefined
          | null
          | string
          | HTMLCanvasElement>

      Query string or reference to canvas element

    • OptionalonResized: ((args: CanvasResizeArgs) => void)

      Callback for when resize happens, eg for redrawing canvas

    • skipCss: boolean = false

      if true, style are not added

    Returns Reactive<{
        innerHeight: number;
        innerWidth: number;
    }>

    Observable