Skip to main content

correct_offscreen

Function correct_offscreen 

Source
pub fn correct_offscreen(
    x: f64,
    y: f64,
    width: f64,
    height: f64,
    monitors: &[MonitorSnapshot],
) -> (f64, f64)
Expand description

Move a window rectangle (logical pixels) back on-screen. A rectangle whose title strip is reachable on some monitor (at least CLAMP_MARGIN_X wide, CLAMP_MARGIN_Y tall inside it) is returned unchanged; otherwise it is clamped onto the monitor nearest its centre. No monitors: unchanged.