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]
fn new(
bounds: [f64; 4],
area: [f64; 2],
settings: &ScrollSettings
) -> ScrollController
[src]
bounds: [f64; 4],
area: [f64; 2],
settings: &ScrollSettings
) -> ScrollController
Creates a new ScrollController
.
fn visible_area_rect(&self) -> [f64; 4]
[src]
Returns the visible rectangle that intersects with the area. This is used to find what part of the area the user is looking at.
fn rect_from_area_to_view(&self, rect: [f64; 4]) -> [f64; 4]
[src]
Transform a rectangle from area coordinates to view.
fn event<E: GenericEvent>(&mut self, e: &E)
[src]
Handles event.
Trait Implementations
impl Clone for ScrollController
[src]
fn clone(&self) -> ScrollController
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more