Skip to main content

Module scale

Module scale 

Expand description

Display-scale plumbing shared by the render loop.

Tilo separates two scale factors, multiplied at composite time: device scale — the per-output fractional factor the compositor reports via wp_fractional_scale_v1 (a true fraction, not rounded to an integer) — and user UI scale, the “make everything bigger” preference already baked into crate::theme::Theme’s tokens.

Widgets lay out in logical pixels (already grown by the user scale via the theme); composite_transform applies only the device scale when drawing into the Vello scene. Because Vello rasterises vector geometry at the transformed resolution, the result is crisp at any fractional device scale — no intermediate low-res raster gets blurrily upscaled.

Structs§

SafeArea
The part of the window that system chrome drawn over it (status and navigation bars, a display cutout, a soft keyboard) leaves visible, as logical-pixel insets from each edge. Zero wherever the platform keeps its chrome outside the window.

Functions§

composite_transform
Uniform scale by the device factor only — widget rects live in logical space, and Vello rasterises at the transformed (physical) resolution.
logical_size
The available space handed to the layout solver: widgets size themselves in logical px, so the physical window is divided by the device scale before layout.
physical_font_px
ui_scale/text_scale are accepted separately so a caller starting from an unscaled base size can compute the whole chain in one explicit, testable call.
physical_len
physical_point
Inverse of the layout division in logical_size. Used by tests and hit-testing to reason about where logical geometry lands physically.