[][src]Struct scroll_controller::ScrollController

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.

Implementations

impl ScrollController[src]

pub fn new(
    bounds: [f64; 4],
    area: [f64; 2],
    settings: &ScrollSettings
) -> ScrollController
[src]

Creates a new ScrollController.

pub 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.

pub fn rect_from_area_to_view(&self, rect: [f64; 4]) -> [f64; 4][src]

Transform a rectangle from area coordinates to view.

pub fn event<E: GenericEvent>(&mut self, e: &E)[src]

Handles event.

Trait Implementations

impl Clone for ScrollController[src]

impl Debug for ScrollController[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.