Skip to main content

euv_core/scene/animation/
struct.rs

1use super::*;
2
3/// Paint-only opacity and 2D transform transition animated per frame without re-running layout.
4#[derive(Clone, Copy, Data, Debug, PartialEq)]
5pub struct NodeTransition {
6    /// Target retained scene node being animated.
7    #[get(type(copy))]
8    pub(crate) node: NodeId,
9    /// Elapsed animation time in seconds.
10    #[get(type(copy))]
11    pub(crate) elapsed: f32,
12    /// Optional delay in seconds before interpolation starts (holds `from_*` values).
13    #[get(type(copy))]
14    pub(crate) delay: f32,
15    /// Total transition duration in seconds.
16    #[get(type(copy))]
17    pub(crate) duration: f32,
18    /// Timing curve evaluated over normalized progress `[0.0, 1.0]`.
19    #[get(type(copy))]
20    pub(crate) easing: Easing,
21    /// Initial opacity value at `t = 0.0`.
22    #[get(type(copy))]
23    pub(crate) from_opacity: f32,
24    /// Target opacity value at `t = 1.0`.
25    #[get(type(copy))]
26    pub(crate) to_opacity: f32,
27    /// Initial horizontal translation offset in logical pixels.
28    #[get(type(copy))]
29    pub(crate) from_tx: f32,
30    /// Target horizontal translation offset in logical pixels.
31    #[get(type(copy))]
32    pub(crate) to_tx: f32,
33    /// Initial vertical translation offset in logical pixels.
34    #[get(type(copy))]
35    pub(crate) from_ty: f32,
36    /// Target vertical translation offset in logical pixels.
37    #[get(type(copy))]
38    pub(crate) to_ty: f32,
39    /// Initial uniform scale factor.
40    #[get(type(copy))]
41    pub(crate) from_scale: f32,
42    /// Target uniform scale factor.
43    #[get(type(copy))]
44    pub(crate) to_scale: f32,
45    /// When `true`, sets `Display::None` on `node` once the exit animation completes.
46    #[get(type(copy))]
47    pub(crate) hide_on_complete: bool,
48}