Function classify_window_affordance_hit

Source
pub fn classify_window_affordance_hit(
    bounds: Rect,
    style: &WindowAffordanceStyle,
    pos: Point,
    movable: bool,
    resizable: bool,
    show_controls: bool,
) -> Option<WindowAffordanceKind>
Expand description

Resolves a point to the highest-priority enabled chrome affordance.

Points outside bounds return None. Visible controls win over resize regions, corners win over edges, and move is considered last. Dimensions are interpreted as screen logical pixels.

ยงExamples

use ailloli_ui_core::{Point, Rect};
use ailloli_ui_widgets::chrome::{classify_window_affordance_hit, WindowAffordanceKind, WindowAffordanceStyle};
let hit = classify_window_affordance_hit(
    Rect::new(0.0, 0.0, 320.0, 220.0),
    &WindowAffordanceStyle::default(),
    Point::new(80.0, 20.0),
    true,
    true,
    true,
);
assert_eq!(hit, Some(WindowAffordanceKind::Move));