Struct ScrollGlide
pub struct ScrollGlide { /* private fields */ }Expand description
The glide of a scroll view that pans both ways (a document, a canvas, a
wide table): one ScrollMomentum per axis, so it decays as every list
glides (glide_step) and steps in whole device pixels, which a host
that copies what a scroll keeps on screen copies.
Implementations§
§impl ScrollGlide
impl ScrollGlide
pub fn new() -> ScrollGlide
pub fn fling(&mut self, vx: f64, vy: f64)
pub fn fling(&mut self, vx: f64, vy: f64)
Glide on from a release velocity (logical pixels per second, in
content space). A zero velocity stops it.
pub fn stop(&mut self)
pub fn stop_x(&mut self)
pub fn stop_x(&mut self)
Stop the glide across, and along it is left as it is.
pub fn stop_y(&mut self)
pub fn stop_y(&mut self)
Stop the glide up or down, and across it is left as it is.
pub fn set_device_scale(&mut self, device_per_unit: f64)
pub fn set_device_scale(&mut self, device_per_unit: f64)
How many device pixels one logical pixel is on the display drawn to.
pub fn advance(&mut self, now: Instant) -> (f64, f64)
pub fn advance(&mut self, now: Instant) -> (f64, f64)
Advance to now (the frame’s time): the displacement since the last
step, in whole device pixels per axis.
pub fn advance_by(&mut self, elapsed: Duration) -> (f64, f64)
pub fn advance_by(&mut self, elapsed: Duration) -> (f64, f64)
Advance by elapsed, for a driver with its own frame clock.
pub fn is_active(&self) -> bool
Trait Implementations§
§impl Clone for ScrollGlide
impl Clone for ScrollGlide
§fn clone(&self) -> ScrollGlide
fn clone(&self) -> ScrollGlide
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for ScrollGlide
impl Debug for ScrollGlide
§impl Default for ScrollGlide
impl Default for ScrollGlide
§fn default() -> ScrollGlide
fn default() -> ScrollGlide
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for ScrollGlide
impl !RefUnwindSafe for ScrollGlide
impl Send for ScrollGlide
impl !Sync for ScrollGlide
impl Unpin for ScrollGlide
impl UnsafeUnpin for ScrollGlide
impl UnwindSafe for ScrollGlide
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,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.