pub struct EditorClickState { /* private fields */ }Expand description
History used to recognize single, double, and triple clicks.
State starts empty. Click counts are capped at three and a sequence requires compatible timestamps, equal byte/zone, at most 500 ms, and at most four logical pixels of movement.
§Examples
use std::time::Duration;
use ailloli_ui_core::Point;
use ailloli_ui_editor::{EditorClickZone, EditorSession};
use ailloli_ui_text::TextBuffer;
let mut session = EditorSession::new(TextBuffer::new());
assert_eq!(session.register_pointer_click_at(Duration::ZERO, Point::new(0.0, 0.0), 0, EditorClickZone::Text), 1);
assert_eq!(session.register_pointer_click_at(Duration::from_millis(100), Point::new(1.0, 0.0), 0, EditorClickZone::Text), 2);Trait Implementations§
Source§impl Clone for EditorClickState
impl Clone for EditorClickState
Source§fn clone(&self) -> EditorClickState
fn clone(&self) -> EditorClickState
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EditorClickState
impl Debug for EditorClickState
Source§impl Default for EditorClickState
impl Default for EditorClickState
Source§fn default() -> EditorClickState
fn default() -> EditorClickState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for EditorClickState
impl RefUnwindSafe for EditorClickState
impl Send for EditorClickState
impl Sync for EditorClickState
impl Unpin for EditorClickState
impl UnwindSafe for EditorClickState
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