pub struct CsdController {
pub geometry: CsdGeometry,
pub is_dragging: bool,
pub active_zone: CsdHitZone,
pub drag_start_pos: Option<(f32, f32)>,
}Expand description
High-level controller managing CSD geometry, hit-testing, and native drag tracking.
Fields§
§geometry: CsdGeometry§is_dragging: bool§active_zone: CsdHitZone§drag_start_pos: Option<(f32, f32)>Implementations§
Source§impl CsdController
impl CsdController
Sourcepub fn new(geometry: CsdGeometry) -> Self
pub fn new(geometry: CsdGeometry) -> Self
Creates a new CsdController with the given geometry.
Sourcepub fn hit_test(
&self,
window_width: f32,
window_height: f32,
x: f32,
y: f32,
) -> CsdHitZone
pub fn hit_test( &self, window_width: f32, window_height: f32, x: f32, y: f32, ) -> CsdHitZone
Performs hit-testing against the managed geometry.
Sourcepub fn on_pointer_down(
&mut self,
window_width: f32,
window_height: f32,
x: f32,
y: f32,
) -> CsdHitZone
pub fn on_pointer_down( &mut self, window_width: f32, window_height: f32, x: f32, y: f32, ) -> CsdHitZone
Processes a pointer down event and records drag start candidate coordinates.
Sourcepub fn on_pointer_up(&mut self)
pub fn on_pointer_up(&mut self)
Resets drag tracking state on pointer up.
Sourcepub fn should_start_drag(&mut self, x: f32, y: f32) -> bool
pub fn should_start_drag(&mut self, x: f32, y: f32) -> bool
Returns true if the pointer has travelled past the minimum drag threshold.
Trait Implementations§
Source§impl Clone for CsdController
impl Clone for CsdController
Source§impl Debug for CsdController
impl Debug for CsdController
Auto Trait Implementations§
impl Forget for CsdController
impl Freeze for CsdController
impl Move for CsdController
impl RefUnwindSafe for CsdController
impl Send for CsdController
impl Sync for CsdController
impl Unpin for CsdController
impl UnsafeUnpin for CsdController
impl UnwindSafe for CsdController
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more