Skip to main content

compute_popover_anchor

Function compute_popover_anchor 

Source
fn compute_popover_anchor(
    click_x: i32,
    click_y: i32,
    window_w: i32,
    monitors: &[MonitorBounds],
) -> Option<(i32, i32)>
Expand description

Pure compute step shared by anchor_window_to_click (runtime) and the unit tests (no Tauri). Returns the popover’s target top-left position (anchored top-right of the picked monitor) in screen coordinates, or None if the monitor list is empty.

Splitting this out exists so the click → monitor-pick → top-right-anchor pipeline is verifiable without spinning up a Tauri mock app — see the unit tests below.