Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
SnapPolicy.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 fuddlesworth
2// SPDX-License-Identifier: LGPL-2.1-or-later
3
4#pragma once
5
6#include <PhosphorAnimation/Interpolate.h> // kRectSizeEpsilonPx
10#include <PhosphorAnimation/phosphoranimation_export.h>
11
12#include <QRectF>
13
14#include <optional>
15
16namespace PhosphorAnimation {
17
18class IMotionClock;
19
22namespace SnapPolicy {
23
29
30inline constexpr qreal kSnapSizeEpsilonPx = kRectSizeEpsilonPx;
31
35PHOSPHORANIMATION_EXPORT std::optional<MotionSpec<QRectF>>
36createSnapSpec(const QRectF& oldFrame, const QRectF& newFrame, const SnapParams& params, IMotionClock* clock);
37
38} // namespace SnapPolicy
39
40} // namespace PhosphorAnimation
Abstract clock interface for the motion runtime.
Definition IMotionClock.h:18
Configuration for a single animation event.
Definition Profile.h:33
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 si...
constexpr qreal kSnapSizeEpsilonPx
Definition SnapPolicy.h:30
Definition AnimatedValue.h:31
constexpr qreal kRectSizeEpsilonPx
Sub-pixel epsilon for rect size-change detection.
Definition Interpolate.h:26
RetargetPolicy
How an in-flight AnimatedValue<T> reshapes on retarget().
Definition RetargetPolicy.h:9
@ PreserveVelocity
Carry velocity across the segment boundary, re-scaled to the new distance. Default.
RetargetPolicy retargetPolicy
Definition SnapPolicy.h:27
Profile profile
Definition SnapPolicy.h:26