#[non_exhaustive]pub enum UiScale {
Pixel(u32),
Free(f32),
}Expand description
How the UI units of a UiView map onto the output.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Pixel(u32)
Pixel UI: a UI unit is this many pixels of the virtual image (0 is
1), scaled up with the world by the upscale’s whole factor, from the
image’s top-left corner, and cut to the image: nothing is drawn on
the bars around it. Corners snap to whole UI units, so its pixels
line up as the world’s do. The default, Pixel(1), is the virtual
image’s own pixels.
Free(f32)
A free scale: output pixels per UI unit, from the output’s top-left corner, over all of it, bars included: the settings’ UI scale.
The pixels are the output’s, which are physical: where the desktop doubles its pixels, 2 is the size its 1 looks. Corners snap to whole output pixels. A scale that is not whole puts some texels on more pixels than others, and a texel’s edge on the middle of a pixel, which GPUs may sample differently. Below 1/8 (0 and negatives too) is 1/8, above 64 is 64, and NaN is 1.