Loading...
Searching...
No Matches
juce::AnimatedPositionBehaviours::SnapToPageBoundaries Struct Reference

## Detailed Description

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

The documentation for this struct was generated from the following file:

- juce_gui_basics/layout/juce_AnimatedPositionBehaviours.h

## Public Member Functions

| SnapToPageBoundaries ()=default
void | releasedWithVelocity (double position, double releaseVelocity) noexcept
| Called by the AnimatedPosition class.
double | getNextPosition (double oldPos, double elapsedSeconds) const noexcept
| Called by the AnimatedPosition class to get the new position, after the given time has elapsed.
bool | isStopped (double position) const noexcept
| Called by the AnimatedPosition class to check whether the object is now stationary.

## Constructors and Destructors

## SnapToPageBoundaries()

juce::AnimatedPositionBehaviours::SnapToPageBoundaries::SnapToPageBoundaries | ( |  | ) |

default

## Member Functions

## releasedWithVelocity()

void juce::AnimatedPositionBehaviours::SnapToPageBoundaries::releasedWithVelocity | ( | double | position,
|  | double | releaseVelocity )

inline noexcept

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.

## getNextPosition()

double juce::AnimatedPositionBehaviours::SnapToPageBoundaries::getNextPosition | ( | double | oldPos,
|  | double | elapsedSeconds ) const

inline noexcept

Called by the AnimatedPosition class to get the new position, after the given time has elapsed.

References isStopped().

## isStopped()

bool juce::AnimatedPositionBehaviours::SnapToPageBoundaries::isStopped | ( | double | position | ) | const

inline noexcept

Called by the AnimatedPosition class to check whether the object is now stationary.

Referenced by getNextPosition().

### Purchase

Get JUCE

### Discover

What's New in JUCE Features

### Learn

Documentaion Tutorials Made with JUCE Resources

### Support

JUCE Forum Newsletter Archive

### About

Contact Us JUCE Legal JUCE Licensing FAQ

### Events

Audio Developer Conference
© Raw Material Software Limited