Skip to main content

translate_physical_pos

Function translate_physical_pos 

Source
pub const fn translate_physical_pos(x: f64, y: f64) -> PhysicalPos
Expand description

Converts a raw f64 cursor position to a PhysicalPos.

f64.max(0.0) as u32: the .max(0.0) clamp makes sign loss intentional. Truncation of the fractional part is also intentional: pixel coordinates are always integers.