pub struct ScrollSpace { /* private fields */ }Expand description
A bounded physical scroll surface with logical coordinates. Re-centering preserves pixel-sized wheel movement instead of multiplying every wheel delta by the ratio of a huge data set to a browser’s safe scroll extent.
Implementations§
Source§impl ScrollSpace
impl ScrollSpace
pub fn new(total: f64, viewport: f64, limit: f64) -> Result<Self, Error>
pub fn extent(&self) -> f64
pub fn origin(&self) -> f64
pub fn project(&self, logical: f64) -> f64
Sourcepub fn seek(&mut self, logical: f64) -> Result<ScrollUpdate, Error>
pub fn seek(&mut self, logical: f64) -> Result<ScrollUpdate, Error>
Programmatic index/end/home navigation uses a logical target. The native scrollbar represents the current segment, not a misleading scaled total.
Trait Implementations§
Auto Trait Implementations§
impl Forget for ScrollSpace
impl Freeze for ScrollSpace
impl Move for ScrollSpace
impl RefUnwindSafe for ScrollSpace
impl Send for ScrollSpace
impl Sync for ScrollSpace
impl Unpin for ScrollSpace
impl UnsafeUnpin for ScrollSpace
impl UnwindSafe for ScrollSpace
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