benilla-re systems structs docs

ClientPointToFractions

function · core · primitive

Address
0x423e20 · 407 bytes, up to 0x423fb6
Signature
void __fastcall (int32_t x, int32_t y, float *u, float *v)
Meaning
Writes x / width and 1 - y / height of the client area, each a 53-bit quotient rounded to a float
Confidence
verified, proof two
Finding
core/input#cursor-coordinates
Test
core::cursor_normalize_matches_binary

Finding: Cursor coordinates in core: window input

An absolute mouse event's position is given as fractions of the client area: x / width and 1 − y / height, from the client rectangle's width and height, so y runs up from the bottom. x is a 53-bit quotient rounded to a float; y is rounded three times: the quotient and the subtraction at 53 bits, then to a float. The client rectangle comes from a cache filled by GetClientRect and by the pump's size check. A confinement rectangle could clamp the point and move the OS cursor, but it is never set: it stays zero, and the clamp is skipped, as it is only for a zero width or height; a NaN difference would run it.

The derivation is in the doc.

Callers 5

Callees 3

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