Skip to content

API reference / Common / Viewport

Interface: Viewport ​

What the engine should paint: a window into document space plus the output surface metrics. The canvas is pinned to the viewport (synthetic scroll), so scrollX/scrollY are a document-space offset, not DOM scroll.

Properties ​

PropertyDescription
scrollX
number
Document-space offset of the top-left of the visible window.
scrollY
number
-
zoom
number
Faithful zoom; 1 == 100% (1 document pt → 96/72 CSS px).
dpr
number
Device pixel ratio (CSS px → device px).
width
number
Visible canvas size in CSS px.
height
number
-