Struct scroll_controller::ScrollController
source · 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: f64The scroll speed.
Implementations
sourceimpl 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
sourceimpl Clone for ScrollController
impl Clone for ScrollController
sourcefn clone(&self) -> ScrollController
fn clone(&self) -> ScrollController
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations
impl RefUnwindSafe for ScrollController
impl Send for ScrollController
impl Sync for ScrollController
impl Unpin for ScrollController
impl UnwindSafe for ScrollController
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more