[][src]Trait nannou::ui::scroll::Axis

pub trait Axis {
    fn parallel_range(Rect) -> Range;
fn perpendicular_range(Rect) -> Range;
fn padding_range(Padding) -> Range;
fn mouse_scalar(mouse_xy: [f64; 2]) -> f64;
fn offset_direction() -> f64; }

Methods for distinguishing behaviour between both scroll axes at compile-time.

Required methods

fn parallel_range(Rect) -> Range

The range of the given Rect that is parallel with this Axis.

fn perpendicular_range(Rect) -> Range

The range of the given Rect that is perpendicular with this Axis.

fn padding_range(Padding) -> Range

Given some rectangular Padding, return the Range that corresponds with this Axis.

fn mouse_scalar(mouse_xy: [f64; 2]) -> f64

The coordinate of the given mouse position that corresponds with this Axis.

fn offset_direction() -> f64

A Scalar multiplier representing the direction in which positive offset shifts the scrollable_range (either -1.0 or `1.0).

Loading content...

Implementors

Loading content...