use iced::time::Instant; use iced::Point; /// Mouse / selection interaction state for the viewport. #[derive(Clone, Default)] pub struct SelectionState { pub vp_size: (f32, f32), pub box_anchor: Option, /// World point under the box-selection anchor, so the anchor can be /// re-projected to screen when the camera zooms/pans mid-drag instead of /// staying frozen at its original pixel (which selected the wrong area). /// (#234) pub box_anchor_world: Option, pub box_current: Option, pub box_last: Option<(Point, Point)>, pub box_crossing: bool, pub box_last_crossing: bool, pub poly_active: bool, pub poly_points: Vec, pub poly_crossing: bool, pub poly_last_crossing: bool, pub context_menu: Option, /// True while the context menu's Draw Order sub-items are expanded. pub draworder_submenu: bool, pub last_move_pos: Option, pub left_down: bool, pub left_press_pos: Option, pub left_press_time: Option, pub left_dragging: bool, pub right_down: bool, pub right_press_pos: Option, pub right_press_time: Option, pub right_dragging: bool, pub right_last_pos: Option, /// World point the current orbit drag revolves around (selection or model /// centre), captured when the drag starts so it stays fixed for the whole /// gesture. `None` when no orbit is in progress. (#229) pub orbit_pivot: Option, /// While a command is active, a right-click acts as Enter; the *next* /// consecutive right-click opens the context menu instead. This tracks /// whether the previous right-click already fired Enter. Reset by any /// other interaction (left-click pick, a new command) and on viewport exit. pub right_click_entered: bool, pub middle_down: bool, pub middle_last_pos: Option, pub middle_last_press_time: Option, }