pub struct DragState { /* private fields */ }Expand description
Pointer drag tracker.
Implementations§
Source§impl DragState
impl DragState
Sourcepub fn set_bounds(&self, min_x: f32, max_x: f32, min_y: f32, max_y: f32)
pub fn set_bounds(&self, min_x: f32, max_x: f32, min_y: f32, max_y: f32)
Set rectangular bounds.
Sourcepub fn set_grid_snap(&self, grid: f32)
pub fn set_grid_snap(&self, grid: f32)
Set grid snap size.
Sourcepub fn to_array(&self) -> Float32Array
pub fn to_array(&self) -> Float32Array
Current position.
Sourcepub fn velocity_array(&self) -> Float32Array
pub fn velocity_array(&self) -> Float32Array
Current velocity.
Sourcepub fn is_dragging(&self) -> bool
pub fn is_dragging(&self) -> bool
Whether pointer is captured.
Sourcepub fn pointer_down(&self, x: f32, y: f32, pointer_id: u32)
pub fn pointer_down(&self, x: f32, y: f32, pointer_id: u32)
Pointer down.
Sourcepub fn pointer_move(&self, x: f32, y: f32, pointer_id: u32, dt: f32)
pub fn pointer_move(&self, x: f32, y: f32, pointer_id: u32, dt: f32)
Pointer move with seconds delta.
Trait Implementations§
Source§impl FromWasmAbi for DragState
impl FromWasmAbi for DragState
Source§impl IntoWasmAbi for DragState
impl IntoWasmAbi for DragState
Source§impl LongRefFromWasmAbi for DragState
impl LongRefFromWasmAbi for DragState
Source§impl OptionFromWasmAbi for DragState
impl OptionFromWasmAbi for DragState
Source§impl OptionIntoWasmAbi for DragState
impl OptionIntoWasmAbi for DragState
Source§impl RefFromWasmAbi for DragState
impl RefFromWasmAbi for DragState
Source§type Abi = WasmPtr<WasmRefCell<DragState>>
type Abi = WasmPtr<WasmRefCell<DragState>>
The Wasm ABI type references to
Self are recovered from.Source§impl RefMutFromWasmAbi for DragState
impl RefMutFromWasmAbi for DragState
Source§impl TryFromJsValue for DragState
impl TryFromJsValue for DragState
Source§impl VectorFromWasmAbi for DragState
impl VectorFromWasmAbi for DragState
Source§impl VectorIntoWasmAbi for DragState
impl VectorIntoWasmAbi for DragState
impl SupportsConstructor for DragState
impl SupportsInstanceProperty for DragState
impl SupportsStaticProperty for DragState
Auto Trait Implementations§
impl Freeze for DragState
impl RefUnwindSafe for DragState
impl Send for DragState
impl Sync for DragState
impl Unpin for DragState
impl UnsafeUnpin for DragState
impl UnwindSafe for DragState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.