Skip to main content

baseline_viewport

Function baseline_viewport 

Source
pub fn baseline_viewport(
    baseline: (u32, u32),
    target: (u32, u32),
) -> ViewportRect
Expand description

The region of a target-pixel render target a baseline-aspect scene draws into: the largest rectangle of that aspect that fits, centred.

The content is scaled to this region instead of to the target, so the target only ever adds bars around the picture — a wide window shows the same view a narrow one does, larger, rather than more of it. A scene whose camera is built for the region’s aspect draws undistorted inside it.