Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
PhosphorAnimation::SnapPolicy Namespace Reference

Snap-animation policy gate — decides if a transition merits animation and builds a MotionSpec<QRectF> for AnimatedValue::start(). More...

Classes

struct  SnapParams
 

Functions

PHOSPHORANIMATION_EXPORT std::optional< MotionSpec< QRectF > > createSnapSpec (const QRectF &oldFrame, const QRectF &newFrame, const SnapParams &params, IMotionClock *clock)
 Returns nullopt when clock is null, newFrame is degenerate, or the move is below threshold with no size change.
 

Variables

constexpr qreal kSnapSizeEpsilonPx = kRectSizeEpsilonPx
 

Detailed Description

Snap-animation policy gate — decides if a transition merits animation and builds a MotionSpec<QRectF> for AnimatedValue::start().

Function Documentation

◆ createSnapSpec()

PHOSPHORANIMATION_EXPORT std::optional< MotionSpec< QRectF > > PhosphorAnimation::SnapPolicy::createSnapSpec ( const QRectF &  oldFrame,
const QRectF &  newFrame,
const SnapParams params,
IMotionClock clock 
)

Returns nullopt when clock is null, newFrame is degenerate, or the move is below threshold with no size change.

Otherwise returns a MotionSpec with no callbacks (caller wires those).

Variable Documentation

◆ kSnapSizeEpsilonPx

constexpr qreal PhosphorAnimation::SnapPolicy::kSnapSizeEpsilonPx = kRectSizeEpsilonPx
inlineconstexpr