pub struct ScrollController {
pub offset: [f64; 2],
pub bounds: [f64; 4],
pub area: [f64; 2],
pub speed: f64,
/* private fields */
}
Expand description
Stores information for scrolling.
Fields§
§offset: [f64; 2]
The offset of visible area.
bounds: [f64; 4]
Visible bounds.
area: [f64; 2]
The size of the scrollable area.
speed: f64
The scroll speed.
Implementations§
Source§impl ScrollController
impl ScrollController
Sourcepub fn new(
bounds: [f64; 4],
area: [f64; 2],
settings: &ScrollSettings,
) -> ScrollController
pub fn new( bounds: [f64; 4], area: [f64; 2], settings: &ScrollSettings, ) -> ScrollController
Creates a new ScrollController
.
Sourcepub fn visible_area_rect(&self) -> [f64; 4]
pub fn visible_area_rect(&self) -> [f64; 4]
Returns the visible rectangle that intersects with the area. This is used to find what part of the area the user is looking at.
Sourcepub fn rect_from_area_to_view(&self, rect: [f64; 4]) -> [f64; 4]
pub fn rect_from_area_to_view(&self, rect: [f64; 4]) -> [f64; 4]
Transform a rectangle from area coordinates to view.
Sourcepub fn event<E: GenericEvent>(&mut self, e: &E)
pub fn event<E: GenericEvent>(&mut self, e: &E)
Handles event.
Trait Implementations§
Source§impl Clone for ScrollController
impl Clone for ScrollController
Source§fn clone(&self) -> ScrollController
fn clone(&self) -> ScrollController
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 moreAuto Trait Implementations§
impl Freeze for ScrollController
impl RefUnwindSafe for ScrollController
impl Send for ScrollController
impl Sync for ScrollController
impl Unpin for ScrollController
impl UnwindSafe for ScrollController
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