Struct scroll_controller::ScrollController [−][src]
pub struct ScrollController {
pub offset: [f64; 2],
pub bounds: [f64; 4],
pub area: [f64; 2],
pub speed: f64,
// some fields omitted
}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.
Methods
impl ScrollController[src]
impl ScrollControllerpub fn new(
bounds: [f64; 4],
area: [f64; 2],
settings: &ScrollSettings
) -> ScrollController[src]
pub fn new(
bounds: [f64; 4],
area: [f64; 2],
settings: &ScrollSettings
) -> ScrollControllerCreates a new ScrollController.
pub fn visible_area_rect(&self) -> [f64; 4][src]
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.
pub fn rect_from_area_to_view(&self, rect: [f64; 4]) -> [f64; 4][src]
pub fn rect_from_area_to_view(&self, rect: [f64; 4]) -> [f64; 4]Transform a rectangle from area coordinates to view.
pub fn event<E: GenericEvent>(&mut self, e: &E)[src]
pub fn event<E: GenericEvent>(&mut self, e: &E)Handles event.
Trait Implementations
impl Clone for ScrollController[src]
impl Clone for ScrollControllerfn clone(&self) -> ScrollController[src]
fn clone(&self) -> ScrollControllerReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)1.0.0
[src]Performs copy-assignment from source. Read more
impl Debug for ScrollController[src]
impl Debug for ScrollControllerAuto Trait Implementations
impl Send for ScrollController
impl Send for ScrollControllerimpl Sync for ScrollController
impl Sync for ScrollController