Skip to content

API reference / Common / ViewLength

Type Alias: ViewLength ​

ts
type ViewLength = 
  | {
  pt: number;
}
  | {
  px: number;
};

A view-space length: fixed in document points (so it scales with zoom, reading as part of the paper) or fixed in device pixels (so it stays constant on screen while the content scales — sized for screen chrome like a page-controls overlay).

The camera's content padding (ContentPadding) takes this, and re-resolves Px values against the current zoom and dpi whenever either changes. A host that wants its chrome constant in its own units across density changes re-sends the padding scaled to the new density — the unit conversion is the host boundary's, not the viewer's.