Scenic Scrollable v0.1.0 Scenic.Scrollable.PositionCap View Source
Module for applying limits to a position.
Link to this section Summary
Types
Data structure representing a minimum, or maximum cap which values will be compared against.
The cap can be either a v2/0
or a Scenic.Scrollable.Direction.t/0
.
By using a t:Scenic.Scrollable.Direction/0
it is possible to cap a position only for either its x, or its y value
The settings with which to initialize a t:Scenic.Scrollable.PositionCap.t
.
Both min and max caps are optional, and can be further limited to only the x, or y axes by passing in a t:Scenic.Scrollable.Direction/0
rather than a v2/0
A vector 2 in the form of {x, y}
Functions
Compare the upper and lower limits set in the Scenic.Scrollable.PositionCap.t/0
against the v2/0
provided, and adjusts the v2/0
according to those limits
Initializes a Scenic.Scrollable.PositionCap.t/0
according to the provided Scenic.Scrollable.PositionCap.settings/0
Link to this section Types
cap() View Source
Data structure representing a minimum, or maximum cap which values will be compared against.
The cap can be either a v2/0
or a Scenic.Scrollable.Direction.t/0
.
By using a t:Scenic.Scrollable.Direction/0
it is possible to cap a position only for either its x, or its y value.
settings() View Source
The settings with which to initialize a t:Scenic.Scrollable.PositionCap.t
.
Both min and max caps are optional, and can be further limited to only the x, or y axes by passing in a t:Scenic.Scrollable.Direction/0
rather than a v2/0
.
A struct representing a position cap. Positions in the form of a v2/0
can be compared against, and increased or reduced to the capped values by using the cap/2
function.
v2()
View Source
v2() :: Scenic.Scrollable.v2()
v2() :: Scenic.Scrollable.v2()
A vector 2 in the form of {x, y}
Link to this section Functions
cap(map, coordinate) View Source
Compare the upper and lower limits set in the Scenic.Scrollable.PositionCap.t/0
against the v2/0
provided, and adjusts the v2/0
according to those limits.
init(settings) View Source
Initializes a Scenic.Scrollable.PositionCap.t/0
according to the provided Scenic.Scrollable.PositionCap.settings/0
.