benilla-re systems structs docs

PixelAlignX

function · ui · primitive

Address
0x7666a0 · 162 bytes, up to 0x766741
Meaning
Rounds a horizontal length up to whole device pixels
Confidence
verified, proof two
Finding
ui/regions#pixel-alignment
Test
ui::glue_765_7666a0_ratio_round_x

Finding: Pixel alignment in ui: regions in the layout

PixelAlignX(x) and PixelAlignY(y) round a layout length up to a whole number of device pixels. A length below 2^-22 in size, and any length on a viewport of no width or height, comes back unchanged. Otherwise the length is divided by the horizontal or vertical screen scale, multiplied by the viewport's size in pixels, increased by 0.99999 when it is positive, truncated toward zero, divided by the pixel size again and multiplied by the screen scale. A positive length therefore gains a pixel unless it already is a whole number of pixels, and a negative length is truncated.

The derivation is in the doc.

Callers 1

Callees 4

Calls and jumps by a bare address, from tables/calls.tsv.