CArcScrollAnimator
- Module
- Arc
- Header
#include "Arc/Widgets/CArcScrollAnimator.h"- Namespace
Arcf
Properties
| Type | Name | Description |
|---|---|---|
static constexpr float | FLING_SECONDS | Duration of a fling's deceleration. Default 0.6f. |
static constexpr float | FLING_MIN_VELOCITY | Below this release speed a drag just stops. Default 120.0f. |
Constructors
| Signature | Name | Description |
|---|---|---|
CArcScrollAnimator() | CArcScrollAnimator |
Public functions
| Returns | Name | Description |
|---|---|---|
void | AnimateTo | Retargets toward target from wherever the content is drawn now (visibleOffset). |
void | Fling | A released drag carries on at velocity (content px per second) and decelerates to rest. |
void | Stop | |
bool | Resolve | Writes the offset this frame should lay out at, clamped to the range the owner can scroll now (content may have shrunk mid-animation), and returns true; false (offset untouched) when idle. |
float | GetTarget | Where the animation will land. |
bool | IsAnimating | |
void | SetSmoothScrollEnabled | Process-wide switch (the editor exposes it as a preference); off makes every wheel notch a jump, as before. |
bool | IsSmoothScrollEnabled |
Function details
CArcScrollAnimator
CArcScrollAnimator()AnimateTo
void AnimateTo(float visibleOffset, float target)Retargets toward target from wherever the content is drawn now (visibleOffset). Consecutive notches accumulate on the target, so a fast spin travels the full distance instead of restarting short.
Fling
void Fling(float visibleOffset, float velocity, float minOffset, float maxOffset)A released drag carries on at velocity (content px per second) and decelerates to rest. The distance is chosen so the curve's starting speed equals the release speed: no kick, no stall.
Stop
void Stop()Resolve
bool Resolve(float& inOutOffset, float minOffset, float maxOffset)Writes the offset this frame should lay out at, clamped to the range the owner can scroll now (content may have shrunk mid-animation), and returns true; false (offset untouched) when idle. Called from the owner's arrange, once per frame.
GetTarget
float GetTarget(float currentOffset) constWhere the animation will land. Callers stack wheel notches on this.
IsAnimating
bool IsAnimating() constSetSmoothScrollEnabled
static void SetSmoothScrollEnabled(bool enabled)Process-wide switch (the editor exposes it as a preference); off makes every wheel notch a jump, as before.
IsSmoothScrollEnabled
static bool IsSmoothScrollEnabled()