A behaviour that gravitates an AnimatedPosition object towards the nearest integer position when released.
More...
#include <juce_AnimatedPositionBehaviours.h>
A behaviour that gravitates an AnimatedPosition object towards the nearest integer position when released.
This class is intended to be used as a template parameter to the AnimatedPosition class. It's handy when using an AnimatedPosition to show a series of pages, because it allows the pages can be scrolled smoothly, but when released, snaps back to show a whole page.
- See also
- AnimatedPosition
◆ SnapToPageBoundaries()
AnimatedPositionBehaviours::SnapToPageBoundaries::SnapToPageBoundaries |
( |
| ) |
|
|
inlinenoexcept |
◆ getNextPosition()
double AnimatedPositionBehaviours::SnapToPageBoundaries::getNextPosition |
( |
double |
oldPos, |
|
|
double |
elapsedSeconds |
|
) |
| const |
|
inlinenoexcept |
◆ isStopped()
bool AnimatedPositionBehaviours::SnapToPageBoundaries::isStopped |
( |
double |
position | ) |
const |
|
inlinenoexcept |
Called by the AnimatedPosition class to check whether the object is now stationary.
◆ releasedWithVelocity()
void AnimatedPositionBehaviours::SnapToPageBoundaries::releasedWithVelocity |
( |
double |
position, |
|
|
double |
releaseVelocity |
|
) |
| |
|
inlinenoexcept |
Called by the AnimatedPosition class.
This tells us the position and velocity at which the user is about to release the object. The velocity is measured in units/second.
◆ targetSnapPosition
double AnimatedPositionBehaviours::SnapToPageBoundaries::targetSnapPosition |
|
private |
The documentation for this struct was generated from the following file: