The widget half of the widget catalogue's later work, ported onto makepad-widgets-core and the family crates. - libs/tween: a dependency-free tween and timeline engine -- nested timelines with positions and labels, stagger, repeat and yoyo, seek and reverse, time scale, a ticker with lag smoothing, a global pause and reduced motion, colour-space interpolation, keyframes and motion paths. The core binds it to the widget tree (tween, a widget's TweenHost), gives script a mod.tween (tween_script) and a live inspector (tween_inspect, tween_inspector). The Animator's Ease now answers from the engine's easing, so the curves have one source; the Animator keeps its states, its keyframe timelines and its own clock. - libs/gizmo and a Gizmo3d / ViewCube widget. - core: the ease editor, the sequencer, diagonal headings, hotkeys, the hotkey editor and keyboard map, the overlay layer host, a conceding row and the width a widget would take without drawing; a theme mix and a person's own theme edits that survive a style reload (theme_mix, set_theme_edit), both taken off by set_base_theme. - the surface material: buttons, check boxes, toggles, sliders and knobs carry the moulded material behind one uniform, a press idiom per sign of material_press, and four sheets that raise it: neumorphic, molded, glossy and milled. - the sheets: a row of fields is one height under every sheet. A sheet line that names a widget the app did not register (a family left out) is skipped when the sheet installs, so the date fields a sheet sizes need the dates family only where it is linked. - extras: the gradient editor, registered with the colour picker it builds on. - tweaker: the designer (a widget's literal located and edited in its source as hunks), the theme lab and the theme builder. The window reads the docked panel's band through the tweaker's hooks. - the panel no longer wears the app's theme (the design surface keeps its own palette), so the worn-theme tests go with it. Five theme builder tests fail here as they do on the branch this comes from (every_built_theme_reads and four more on text contrast); radial_menu's tab_under_an_open_menu_finds_nowhere_to_go fails here as it does on dev.
536 lines
30 KiB
Rust
536 lines
30 KiB
Rust
// GENERATED by gsap/emit_rust.js from gsap/out/timescale.json -- do not edit by hand.
|
|
// GSAP 3.15.0 under Node v22.22.2; generator golden.js; root time after the frame tick: 0.
|
|
// Numbers are the golden doubles (shortest round-trip repr, bit-exact). Tolerances are the test's business
|
|
// (see design/gsap_reconciliation.md D: GSAP rounds written property values to 1e-6, so value columns need 5e-7).
|
|
// Sampled cases: columnar series (outer.time, inner.time, ..., x) against outer.totalTime(t); `ops` cases: flattened rows in call order.
|
|
#![allow(
|
|
dead_code,
|
|
unused_imports,
|
|
clippy::approx_constant,
|
|
clippy::excessive_precision,
|
|
clippy::unreadable_literal
|
|
)]
|
|
use super::common::*;
|
|
|
|
pub const GSAP_VERSION: &str = "3.15.0";
|
|
pub const NOTES: &[&str] = &[
|
|
"samples columns aligned with samples.t = outer.totalTime(t) values set in increasing order.",
|
|
];
|
|
|
|
#[derive(Clone, Copy, Debug)]
|
|
pub struct TimeScaleCase {
|
|
pub id: &'static str,
|
|
pub description: &'static str,
|
|
pub gsap_calls: &'static [&'static str],
|
|
pub meta: Pairs,
|
|
pub t: &'static [f64],
|
|
pub series: &'static [Series],
|
|
pub ops: &'static [Pairs],
|
|
}
|
|
pub const CASES: &[TimeScaleCase] = &[
|
|
TimeScaleCase { id: "inner_timescale_2", description: "inner (2 s, x 0->100 linear) with timeScale 2 added at 1 -> occupies 1..2",
|
|
gsap_calls: &["outer=gsap.timeline({paused:true})", "inner=gsap.timeline(); inner.to(o,{x:100,duration:2,ease:\"none\"})", "inner.timeScale(2)", "outer.add(inner, 1)"],
|
|
meta: &[
|
|
("driver", Val::S("outer.totalTime(t) (increasing t)")), ("outer_duration", Val::F(2.0)), ("outer_totalDuration", Val::F(2.0)),
|
|
("inner_startTime", Val::F(1.0)), ("inner_endTime", Val::F(2.0)), ("inner_timeScale", Val::F(2.0)), ("inner_reversed", Val::B(false)),
|
|
("inner_duration", Val::F(2.0)), ("inner_totalDuration", Val::F(2.0)),
|
|
],
|
|
t: &[
|
|
0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9,
|
|
1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9,
|
|
2.0, 2.1, 2.2, 2.3, 2.4, 2.5,
|
|
],
|
|
series: &[
|
|
Series { name: "outer.time", v: &[
|
|
0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9,
|
|
1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9,
|
|
2.0, 2.0, 2.0, 2.0, 2.0, 2.0,
|
|
] },
|
|
Series { name: "inner.time", v: &[
|
|
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
|
0.0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 1.6, 1.8,
|
|
2.0, 2.0, 2.0, 2.0, 2.0, 2.0,
|
|
] },
|
|
Series { name: "inner.totalTime", v: &[
|
|
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
|
0.0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 1.6, 1.8,
|
|
2.0, 2.0, 2.0, 2.0, 2.0, 2.0,
|
|
] },
|
|
Series { name: "inner.progress", v: &[
|
|
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
|
0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9,
|
|
1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
|
|
] },
|
|
Series { name: "x", v: &[
|
|
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
|
0.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0,
|
|
100.0, 100.0, 100.0, 100.0, 100.0, 100.0,
|
|
] },
|
|
],
|
|
ops: &[] },
|
|
TimeScaleCase { id: "inner_timescale_0_5", description: "inner timeScale 0.5 at 1 -> occupies 1..5",
|
|
gsap_calls: &["outer=gsap.timeline({paused:true})", "inner=...", "inner.timeScale(0.5)", "outer.add(inner, 1)"],
|
|
meta: &[
|
|
("driver", Val::S("outer.totalTime(t) (increasing t)")), ("outer_duration", Val::F(5.0)), ("outer_totalDuration", Val::F(5.0)),
|
|
("inner_startTime", Val::F(1.0)), ("inner_endTime", Val::F(5.0)), ("inner_timeScale", Val::F(0.5)), ("inner_reversed", Val::B(false)),
|
|
("inner_duration", Val::F(2.0)), ("inner_totalDuration", Val::F(2.0)),
|
|
],
|
|
t: &[
|
|
0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9,
|
|
1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9,
|
|
2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9,
|
|
3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9,
|
|
4.0, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9,
|
|
5.0, 5.1, 5.2, 5.3, 5.4, 5.5,
|
|
],
|
|
series: &[
|
|
Series { name: "outer.time", v: &[
|
|
0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9,
|
|
1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9,
|
|
2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9,
|
|
3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9,
|
|
4.0, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9,
|
|
5.0, 5.0, 5.0, 5.0, 5.0, 5.0,
|
|
] },
|
|
Series { name: "inner.time", v: &[
|
|
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
|
0.0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45,
|
|
0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95,
|
|
1.0, 1.05, 1.1, 1.15, 1.2, 1.25, 1.3, 1.35, 1.4, 1.45,
|
|
1.5, 1.55, 1.6, 1.65, 1.7, 1.75, 1.8, 1.85, 1.9, 1.95,
|
|
2.0, 2.0, 2.0, 2.0, 2.0, 2.0,
|
|
] },
|
|
Series { name: "inner.totalTime", v: &[
|
|
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
|
0.0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45,
|
|
0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95,
|
|
1.0, 1.05, 1.1, 1.15, 1.2, 1.25, 1.3, 1.35, 1.4, 1.45,
|
|
1.5, 1.55, 1.6, 1.65, 1.7, 1.75, 1.8, 1.85, 1.9, 1.95,
|
|
2.0, 2.0, 2.0, 2.0, 2.0, 2.0,
|
|
] },
|
|
Series { name: "inner.progress", v: &[
|
|
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
|
0.0, 0.025, 0.05, 0.075, 0.1, 0.125, 0.15, 0.175, 0.2, 0.225,
|
|
0.25, 0.275, 0.3, 0.325, 0.35, 0.375, 0.4, 0.425, 0.45, 0.475,
|
|
0.5, 0.525, 0.55, 0.575, 0.6, 0.625, 0.65, 0.675, 0.7, 0.725,
|
|
0.75, 0.775, 0.8, 0.825, 0.85, 0.875, 0.9, 0.925, 0.95, 0.975,
|
|
1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
|
|
] },
|
|
Series { name: "x", v: &[
|
|
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
|
0.0, 2.5, 5.0, 7.5, 10.0, 12.5, 15.0, 17.5, 20.0, 22.5,
|
|
25.0, 27.5, 30.0, 32.5, 35.0, 37.5, 40.0, 42.5, 45.0, 47.5,
|
|
50.0, 52.5, 55.0, 57.5, 60.0, 62.5, 65.0, 67.5, 70.0, 72.5,
|
|
75.0, 77.5, 80.0, 82.5, 85.0, 87.5, 90.0, 92.5, 95.0, 97.5,
|
|
100.0, 100.0, 100.0, 100.0, 100.0, 100.0,
|
|
] },
|
|
],
|
|
ops: &[] },
|
|
TimeScaleCase { id: "inner_reversed", description: "inner.reversed(true) (timeScale -1) at 1 -> plays backwards over 1..3",
|
|
gsap_calls: &["outer=gsap.timeline({paused:true})", "inner=...", "inner.reversed(true)", "outer.add(inner, 1)"],
|
|
meta: &[
|
|
("driver", Val::S("outer.totalTime(t) (increasing t)")), ("outer_duration", Val::F(3.0)), ("outer_totalDuration", Val::F(3.0)),
|
|
("inner_startTime", Val::F(1.0)), ("inner_endTime", Val::F(3.0)), ("inner_timeScale", Val::F(-1.0)), ("inner_reversed", Val::B(true)),
|
|
("inner_duration", Val::F(2.0)), ("inner_totalDuration", Val::F(2.0)),
|
|
],
|
|
t: &[
|
|
0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9,
|
|
1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9,
|
|
2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9,
|
|
3.0, 3.1, 3.2, 3.3, 3.4, 3.5,
|
|
],
|
|
series: &[
|
|
Series { name: "outer.time", v: &[
|
|
0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9,
|
|
1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9,
|
|
2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9,
|
|
3.0, 3.0, 3.0, 3.0, 3.0, 3.0,
|
|
] },
|
|
Series { name: "inner.time", v: &[
|
|
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
|
2.0, 1.9, 1.8, 1.7, 1.6, 1.5, 1.4, 1.3, 1.2, 1.1,
|
|
1.0, 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1,
|
|
0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
|
] },
|
|
Series { name: "inner.totalTime", v: &[
|
|
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
|
2.0, 1.9, 1.8, 1.7, 1.6, 1.5, 1.4, 1.3, 1.2, 1.1,
|
|
1.0, 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1,
|
|
0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
|
] },
|
|
Series { name: "inner.progress", v: &[
|
|
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
|
1.0, 0.95, 0.9, 0.85, 0.8, 0.75, 0.7, 0.65, 0.6, 0.55,
|
|
0.5, 0.45, 0.4, 0.35, 0.3, 0.25, 0.2, 0.15, 0.1, 0.05,
|
|
0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
|
] },
|
|
Series { name: "x", v: &[
|
|
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
|
100.0, 95.0, 90.0, 85.0, 80.0, 75.0, 70.0, 65.0, 60.0, 55.0,
|
|
50.0, 45.0, 40.0, 35.0, 30.0, 25.0, 20.0, 15.0, 10.0, 5.0,
|
|
0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
|
] },
|
|
],
|
|
ops: &[] },
|
|
TimeScaleCase { id: "inner_reversed_timescale_0_5", description: "inner.timeScale(0.5).reversed(true) at 1 -> backwards over 1..5",
|
|
gsap_calls: &["inner.timeScale(0.5); inner.reversed(true)", "outer.add(inner, 1)"],
|
|
meta: &[
|
|
("driver", Val::S("outer.totalTime(t) (increasing t)")), ("outer_duration", Val::F(5.0)), ("outer_totalDuration", Val::F(5.0)),
|
|
("inner_startTime", Val::F(1.0)), ("inner_endTime", Val::F(5.0)), ("inner_timeScale", Val::F(-0.5)), ("inner_reversed", Val::B(true)),
|
|
("inner_duration", Val::F(2.0)), ("inner_totalDuration", Val::F(2.0)),
|
|
],
|
|
t: &[
|
|
0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9,
|
|
1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9,
|
|
2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9,
|
|
3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9,
|
|
4.0, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9,
|
|
5.0, 5.1, 5.2, 5.3, 5.4, 5.5,
|
|
],
|
|
series: &[
|
|
Series { name: "outer.time", v: &[
|
|
0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9,
|
|
1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9,
|
|
2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9,
|
|
3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9,
|
|
4.0, 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9,
|
|
5.0, 5.0, 5.0, 5.0, 5.0, 5.0,
|
|
] },
|
|
Series { name: "inner.time", v: &[
|
|
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
|
2.0, 1.95, 1.9, 1.85, 1.8, 1.75, 1.7, 1.65, 1.6, 1.55,
|
|
1.5, 1.45, 1.4, 1.35, 1.3, 1.25, 1.2, 1.15, 1.1, 1.05,
|
|
1.0, 0.95, 0.9, 0.85, 0.8, 0.75, 0.7, 0.65, 0.6, 0.55,
|
|
0.5, 0.45, 0.4, 0.35, 0.3, 0.25, 0.2, 0.15, 0.1, 0.05,
|
|
0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
|
] },
|
|
Series { name: "inner.totalTime", v: &[
|
|
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
|
2.0, 1.95, 1.9, 1.85, 1.8, 1.75, 1.7, 1.65, 1.6, 1.55,
|
|
1.5, 1.45, 1.4, 1.35, 1.3, 1.25, 1.2, 1.15, 1.1, 1.05,
|
|
1.0, 0.95, 0.9, 0.85, 0.8, 0.75, 0.7, 0.65, 0.6, 0.55,
|
|
0.5, 0.45, 0.4, 0.35, 0.3, 0.25, 0.2, 0.15, 0.1, 0.05,
|
|
0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
|
] },
|
|
Series { name: "inner.progress", v: &[
|
|
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
|
1.0, 0.975, 0.95, 0.925, 0.9, 0.875, 0.85, 0.825, 0.8, 0.775,
|
|
0.75, 0.725, 0.7, 0.675, 0.65, 0.625, 0.6, 0.575, 0.55, 0.525,
|
|
0.5, 0.475, 0.45, 0.425, 0.4, 0.375, 0.35, 0.325, 0.3, 0.275,
|
|
0.25, 0.225, 0.2, 0.175, 0.15, 0.125, 0.1, 0.075, 0.05, 0.025,
|
|
0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
|
] },
|
|
Series { name: "x", v: &[
|
|
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
|
100.0, 97.5, 95.0, 92.5, 90.0, 87.5, 85.0, 82.5, 80.0, 77.5,
|
|
75.0, 72.5, 70.0, 67.5, 65.0, 62.5, 60.0, 57.5, 55.0, 52.5,
|
|
50.0, 47.5, 45.0, 42.5, 40.0, 37.5, 35.0, 32.5, 30.0, 27.5,
|
|
25.0, 22.5, 20.0, 17.5, 15.0, 12.5, 10.0, 7.5, 5.0, 2.5,
|
|
0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
|
] },
|
|
],
|
|
ops: &[] },
|
|
TimeScaleCase { id: "inner_repeat1_yoyo_timescale_2", description: "inner {repeat:1, yoyo:true} (tDur 4) with timeScale 2 at 1 -> occupies 1..3",
|
|
gsap_calls: &["inner=gsap.timeline({repeat:1,yoyo:true}); inner.to(o,{x:100,duration:2,ease:\"none\"})", "inner.timeScale(2)", "outer.add(inner, 1)"],
|
|
meta: &[
|
|
("driver", Val::S("outer.totalTime(t) (increasing t)")), ("outer_duration", Val::F(3.0)), ("outer_totalDuration", Val::F(3.0)),
|
|
("inner_startTime", Val::F(1.0)), ("inner_endTime", Val::F(3.0)), ("inner_timeScale", Val::F(2.0)), ("inner_reversed", Val::B(false)),
|
|
("inner_duration", Val::F(2.0)), ("inner_totalDuration", Val::F(4.0)),
|
|
],
|
|
t: &[
|
|
0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9,
|
|
1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9,
|
|
2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9,
|
|
3.0, 3.1, 3.2, 3.3, 3.4, 3.5,
|
|
],
|
|
series: &[
|
|
Series { name: "outer.time", v: &[
|
|
0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9,
|
|
1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9,
|
|
2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9,
|
|
3.0, 3.0, 3.0, 3.0, 3.0, 3.0,
|
|
] },
|
|
Series { name: "inner.time", v: &[
|
|
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
|
0.0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 1.6, 1.8,
|
|
2.0, 1.8, 1.6, 1.4, 1.2, 1.0, 0.8, 0.6000000000000001, 0.3999999999999999, 0.19999999999999996,
|
|
0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
|
] },
|
|
Series { name: "inner.totalTime", v: &[
|
|
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
|
0.0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 1.6, 1.8,
|
|
2.0, 2.2, 2.4, 2.6, 2.8, 3.0, 3.2, 3.4, 3.6, 3.8,
|
|
4.0, 4.0, 4.0, 4.0, 4.0, 4.0,
|
|
] },
|
|
Series { name: "inner.progress", v: &[
|
|
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
|
0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9,
|
|
1.0, 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.30000000000000004, 0.19999999999999996, 0.09999999999999998,
|
|
0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
|
] },
|
|
Series { name: "x", v: &[
|
|
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
|
0.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0,
|
|
100.0, 90.0, 80.0, 70.0, 60.0, 50.0, 40.0, 30.0, 20.0, 10.0,
|
|
0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
|
] },
|
|
],
|
|
ops: &[] },
|
|
TimeScaleCase { id: "tween_child_timescale_2", description: "a TWEEN child (1 s) with timeScale(2) at 0 -> occupies 0..0.5 (inner.* columns describe the tween)",
|
|
gsap_calls: &["tw=gsap.to(o,{x:100,duration:1,ease:\"none\"}).timeScale(2)", "outer.add(tw, 0)"],
|
|
meta: &[
|
|
("driver", Val::S("outer.totalTime(t) (increasing t)")), ("outer_duration", Val::F(1.0)), ("outer_totalDuration", Val::F(1.0)),
|
|
("inner_startTime", Val::F(0.0)), ("inner_endTime", Val::F(0.5)), ("inner_timeScale", Val::F(2.0)), ("inner_reversed", Val::B(false)),
|
|
("inner_duration", Val::F(1.0)), ("inner_totalDuration", Val::F(1.0)),
|
|
],
|
|
t: &[
|
|
0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9,
|
|
1.0, 1.1, 1.2,
|
|
],
|
|
series: &[
|
|
Series { name: "outer.time", v: &[
|
|
0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9,
|
|
1.0, 1.0, 1.0,
|
|
] },
|
|
Series { name: "inner.time", v: &[
|
|
0.0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.0, 1.0, 1.0, 1.0,
|
|
1.0, 1.0, 1.0,
|
|
] },
|
|
Series { name: "inner.totalTime", v: &[
|
|
0.0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.0, 1.0, 1.0, 1.0,
|
|
1.0, 1.0, 1.0,
|
|
] },
|
|
Series { name: "inner.progress", v: &[
|
|
0.0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.0, 1.0, 1.0, 1.0,
|
|
1.0, 1.0, 1.0,
|
|
] },
|
|
Series { name: "x", v: &[
|
|
0.0, 20.0, 40.0, 60.0, 80.0, 100.0, 100.0, 100.0, 100.0, 100.0,
|
|
100.0, 100.0, 100.0,
|
|
] },
|
|
],
|
|
ops: &[] },
|
|
TimeScaleCase { id: "tween_child_reversed", description: "a reversed TWEEN child (1 s) at 0 -> x goes 100 -> 0 over 0..1",
|
|
gsap_calls: &["tw=gsap.to(o,{x:100,duration:1,ease:\"none\"}).reversed(true)", "outer.add(tw, 0)"],
|
|
meta: &[
|
|
("driver", Val::S("outer.totalTime(t) (increasing t)")), ("outer_duration", Val::F(1.0)), ("outer_totalDuration", Val::F(1.0)),
|
|
("inner_startTime", Val::F(0.0)), ("inner_endTime", Val::F(1.0)), ("inner_timeScale", Val::F(-1.0)), ("inner_reversed", Val::B(true)),
|
|
("inner_duration", Val::F(1.0)), ("inner_totalDuration", Val::F(1.0)),
|
|
],
|
|
t: &[
|
|
0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9,
|
|
1.0, 1.1, 1.2, 1.3, 1.4, 1.5,
|
|
],
|
|
series: &[
|
|
Series { name: "outer.time", v: &[
|
|
0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9,
|
|
1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
|
|
] },
|
|
Series { name: "inner.time", v: &[
|
|
0.0, 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.30000000000000004, 0.19999999999999996, 0.09999999999999998,
|
|
0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
|
] },
|
|
Series { name: "inner.totalTime", v: &[
|
|
0.0, 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.30000000000000004, 0.19999999999999996, 0.09999999999999998,
|
|
0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
|
] },
|
|
Series { name: "inner.progress", v: &[
|
|
0.0, 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.30000000000000004, 0.19999999999999996, 0.09999999999999998,
|
|
0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
|
] },
|
|
Series { name: "x", v: &[
|
|
0.0, 90.0, 80.0, 70.0, 60.0, 50.0, 40.0, 30.0, 20.0, 10.0,
|
|
0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
|
] },
|
|
],
|
|
ops: &[] },
|
|
TimeScaleCase { id: "three_levels_outer_ts2_inner_ts0_5", description: "root(paused) > mid (timeScale 2) > inner (timeScale 0.5, 2 s): compound scale 1 -> inner occupies root 0..2 (outer.* columns = root, inner.* = innermost)",
|
|
gsap_calls: &["root=gsap.timeline({paused:true})", "mid=gsap.timeline(); inner=gsap.timeline(); inner.to(o,{x:100,duration:2,ease:\"none\"})", "inner.timeScale(0.5); mid.add(inner,0); mid.timeScale(2)", "root.add(mid,0)"],
|
|
meta: &[
|
|
("driver", Val::S("outer.totalTime(t) (increasing t)")), ("outer_duration", Val::F(2.0)), ("outer_totalDuration", Val::F(2.0)),
|
|
("inner_startTime", Val::F(0.0)), ("inner_endTime", Val::F(4.0)), ("inner_timeScale", Val::F(0.5)), ("inner_reversed", Val::B(false)),
|
|
("inner_duration", Val::F(2.0)), ("inner_totalDuration", Val::F(2.0)), ("mid_startTime", Val::F(0.0)), ("mid_endTime", Val::F(2.0)),
|
|
("mid_duration", Val::F(4.0)), ("mid_timeScale", Val::F(2.0)),
|
|
],
|
|
t: &[
|
|
0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9,
|
|
1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9,
|
|
2.0, 2.1, 2.2, 2.3, 2.4, 2.5,
|
|
],
|
|
series: &[
|
|
Series { name: "outer.time", v: &[
|
|
0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9,
|
|
1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9,
|
|
2.0, 2.0, 2.0, 2.0, 2.0, 2.0,
|
|
] },
|
|
Series { name: "inner.time", v: &[
|
|
0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9,
|
|
1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9,
|
|
2.0, 2.0, 2.0, 2.0, 2.0, 2.0,
|
|
] },
|
|
Series { name: "inner.totalTime", v: &[
|
|
0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9,
|
|
1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9,
|
|
2.0, 2.0, 2.0, 2.0, 2.0, 2.0,
|
|
] },
|
|
Series { name: "inner.progress", v: &[
|
|
0.0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45,
|
|
0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95,
|
|
1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
|
|
] },
|
|
Series { name: "x", v: &[
|
|
0.0, 5.0, 10.0, 15.0, 20.0, 25.0, 30.0, 35.0, 40.0, 45.0,
|
|
50.0, 55.0, 60.0, 65.0, 70.0, 75.0, 80.0, 85.0, 90.0, 95.0,
|
|
100.0, 100.0, 100.0, 100.0, 100.0, 100.0,
|
|
] },
|
|
],
|
|
ops: &[] },
|
|
TimeScaleCase { id: "negative_timescale", description: "GSAP stores reversal AS a negative timeScale; timeScale(-1) is accepted and equals reversed(true)",
|
|
gsap_calls: &["t=gsap.to(o,{x:100,duration:1,ease:\"none\",paused:true})", "then each op in order"],
|
|
meta: &[],
|
|
t: &[],
|
|
series: &[],
|
|
ops: &[
|
|
&[
|
|
("op", Val::S("created")), ("timeScale", Val::F(1.0)), ("reversed", Val::B(false)), ("paused", Val::B(true)), ("internal_rts", Val::F(1.0)),
|
|
],
|
|
&[
|
|
("op", Val::S("timeScale(-1)")), ("timeScale", Val::F(-1.0)), ("reversed", Val::B(true)), ("paused", Val::B(true)), ("internal_rts", Val::F(-1.0)),
|
|
],
|
|
&[
|
|
("op", Val::S("timeScale(-2)")), ("timeScale", Val::F(-2.0)), ("reversed", Val::B(true)), ("paused", Val::B(true)), ("internal_rts", Val::F(-2.0)),
|
|
],
|
|
&[
|
|
("op", Val::S("reversed(false)")), ("timeScale", Val::F(2.0)), ("reversed", Val::B(false)), ("paused", Val::B(true)), ("internal_rts", Val::F(2.0)),
|
|
],
|
|
&[
|
|
("op", Val::S("reversed(true)")), ("timeScale", Val::F(-2.0)), ("reversed", Val::B(true)), ("paused", Val::B(true)), ("internal_rts", Val::F(-2.0)),
|
|
],
|
|
&[
|
|
("op", Val::S("timeScale(0)")), ("timeScale", Val::F(0.0)), ("reversed", Val::B(false)), ("paused", Val::B(true)), ("internal_rts", Val::F(0.0)),
|
|
],
|
|
&[
|
|
("op", Val::S("reversed(true) while timeScale 0")), ("timeScale", Val::F(0.0)), ("reversed", Val::B(true)), ("paused", Val::B(true)),
|
|
("internal_rts", Val::F(-1e-8)),
|
|
],
|
|
&[
|
|
("op", Val::S("reversed(false)")), ("timeScale", Val::F(1e-8)), ("reversed", Val::B(false)), ("paused", Val::B(true)), ("internal_rts", Val::F(1e-8)),
|
|
],
|
|
&[
|
|
("op", Val::S("timeScale(1)")), ("timeScale", Val::F(1.0)), ("reversed", Val::B(false)), ("paused", Val::B(true)), ("internal_rts", Val::F(1.0)),
|
|
]
|
|
] },
|
|
TimeScaleCase { id: "negative_timescale_child", description: "tween child timeScale(-1) AFTER being added at 0 -> behaves exactly like reversed",
|
|
gsap_calls: &["outer=gsap.timeline({paused:true}); tw=gsap.to(o,{x:100,duration:1,ease:\"none\"}); outer.add(tw,0); tw.timeScale(-1)"],
|
|
meta: &[("tween_startTime", Val::F(0.0)), ("tween_endTime", Val::F(1.0)), ("outer_duration", Val::F(1.0))],
|
|
t: &[
|
|
0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9,
|
|
1.0, 1.1, 1.2,
|
|
],
|
|
series: &[
|
|
Series { name: "x", v: &[
|
|
0.0, 90.0, 80.0, 70.0, 60.0, 50.0, 40.0, 30.0, 20.0, 10.0,
|
|
0.0, 0.0, 0.0,
|
|
] },
|
|
Series { name: "tween_time", v: &[
|
|
0.0, 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.30000000000000004, 0.19999999999999996, 0.09999999999999998,
|
|
0.0, 0.0, 0.0,
|
|
] },
|
|
],
|
|
ops: &[] },
|
|
TimeScaleCase { id: "design_t10_nested_time_scales", description: "design 12.3 T10: R (smooth root emulation, stepped relatively like the engine root) > tl > tl2 (timeScale 2, at 1) > tween x 0->100 over 2 s. tl.timeScale(0.5) at R 1.5 re-aligns tl.start to -1.5: R shifts its children +1.5 and its own time to 3 (no visual jump), exactly what the engine root does",
|
|
gsap_calls: &["R=gsap.timeline({paused:true,smoothChildTiming:true}); tl=gsap.timeline(); R.add(tl,0)", "tl2=gsap.timeline(); tl2.to(o,{x:100,duration:2,ease:\"none\"}); tl2.timeScale(2); tl.add(tl2,1)"],
|
|
meta: &[],
|
|
t: &[],
|
|
series: &[],
|
|
ops: &[
|
|
&[
|
|
("op", Val::S("R +1.5")), ("x", Val::F(50.0)), ("R_total_time", Val::F(1.5)), ("tl_time", Val::F(1.5)), ("tl_time_scale", Val::F(1.0)),
|
|
("tl_reversed", Val::B(false)), ("tl_start", Val::F(0.0)),
|
|
],
|
|
&[
|
|
("op", Val::S("tl.timeScale(0.5)")), ("x", Val::F(50.0)), ("R_total_time", Val::F(3.0)), ("tl_time", Val::F(1.5)), ("tl_time_scale", Val::F(0.5)),
|
|
("tl_reversed", Val::B(false)), ("tl_start", Val::F(0.0)),
|
|
],
|
|
&[
|
|
("op", Val::S("R +0.5")), ("x", Val::F(75.0)), ("R_total_time", Val::F(3.5)), ("tl_time", Val::F(1.75)), ("tl_time_scale", Val::F(0.5)),
|
|
("tl_reversed", Val::B(false)), ("tl_start", Val::F(0.0)),
|
|
],
|
|
&[
|
|
("op", Val::S("tl.reverse()")), ("x", Val::F(75.0)), ("R_total_time", Val::F(3.5)), ("tl_time", Val::F(1.75)), ("tl_time_scale", Val::F(-0.5)),
|
|
("tl_reversed", Val::B(true)), ("tl_start", Val::F(3.0)),
|
|
],
|
|
&[
|
|
("op", Val::S("R +0.5")), ("x", Val::F(50.0)), ("R_total_time", Val::F(4.0)), ("tl_time", Val::F(1.5)), ("tl_time_scale", Val::F(-0.5)),
|
|
("tl_reversed", Val::B(true)), ("tl_start", Val::F(3.0)),
|
|
]
|
|
] },
|
|
TimeScaleCase { id: "design_time_scale_no_jump_root_child", description: "design 12.6 time_scale_change_does_not_jump: a child of a smooth parent keeps its value when timeScale changes (start re-aligned); a negative timeScale plays it backwards",
|
|
gsap_calls: &["R=gsap.timeline({paused:true,smoothChildTiming:true}); t=R.to(o,{x:100,duration:1,ease:\"none\"})"],
|
|
meta: &[],
|
|
t: &[],
|
|
series: &[],
|
|
ops: &[
|
|
&[
|
|
("op", Val::S("R.totalTime(0.5)")), ("x", Val::F(50.0)), ("R_total_time", Val::F(0.5)), ("t_total_time", Val::F(0.5)), ("t_start", Val::F(0.0)),
|
|
("t_time_scale", Val::F(1.0)), ("t_reversed", Val::B(false)),
|
|
],
|
|
&[
|
|
("op", Val::S("t.timeScale(2)")), ("x", Val::F(50.0)), ("R_total_time", Val::F(0.5)), ("t_total_time", Val::F(0.5)), ("t_start", Val::F(0.25)),
|
|
("t_time_scale", Val::F(2.0)), ("t_reversed", Val::B(false)),
|
|
],
|
|
&[
|
|
("op", Val::S("R.totalTime(0.6)")), ("x", Val::F(70.0)), ("R_total_time", Val::F(0.6)), ("t_total_time", Val::F(0.7)), ("t_start", Val::F(0.25)),
|
|
("t_time_scale", Val::F(2.0)), ("t_reversed", Val::B(false)),
|
|
],
|
|
&[
|
|
("op", Val::S("t.timeScale(-1)")), ("x", Val::F(70.0)), ("R_total_time", Val::F(0.6)), ("t_total_time", Val::F(0.7)), ("t_start", Val::F(0.3)),
|
|
("t_time_scale", Val::F(-1.0)), ("t_reversed", Val::B(true)),
|
|
],
|
|
&[
|
|
("op", Val::S("R.totalTime(0.7)")), ("x", Val::F(60.0)), ("R_total_time", Val::F(0.7)), ("t_total_time", Val::F(0.6000000000000001)),
|
|
("t_start", Val::F(0.3)), ("t_time_scale", Val::F(-1.0)), ("t_reversed", Val::B(true)),
|
|
]
|
|
] },
|
|
TimeScaleCase { id: "design_time_scale_no_jump_nested_smooth", description: "design 12.6: the same inside a nested smoothChildTiming timeline: t.start = 0.5 - 0.5/0.5 = -0.5 < 0, so tl shifts its children +0.5 and (its parent R being smooth) its own start/time; tl duration becomes 2 and nothing jumps",
|
|
gsap_calls: &["R=gsap.timeline({paused:true,smoothChildTiming:true}); tl=gsap.timeline({smoothChildTiming:true}); R.add(tl,0)", "t=tl.to(o,{x:100,duration:1,ease:\"none\"})"],
|
|
meta: &[],
|
|
t: &[],
|
|
series: &[],
|
|
ops: &[
|
|
&[
|
|
("op", Val::S("R +0.5")), ("x", Val::F(50.0)), ("R_total_time", Val::F(0.5)), ("tl_duration", Val::F(1.0)), ("t_start", Val::F(0.0)),
|
|
("t_total_time", Val::F(0.5)),
|
|
],
|
|
&[
|
|
("op", Val::S("t.timeScale(0.5)")), ("x", Val::F(50.0)), ("R_total_time", Val::F(1.0)), ("tl_duration", Val::F(2.0)), ("t_start", Val::F(0.0)),
|
|
("t_total_time", Val::F(0.5)),
|
|
],
|
|
&[
|
|
("op", Val::S("R +0.5")), ("x", Val::F(75.0)), ("R_total_time", Val::F(1.5)), ("tl_duration", Val::F(2.0)), ("t_start", Val::F(0.0)),
|
|
("t_total_time", Val::F(0.75)),
|
|
]
|
|
] },
|
|
TimeScaleCase { id: "design_smooth_child_timing_duration", description: "design 12.6 smooth_child_timing_recomputes_the_parent (smoothChildTiming:true): child.timeScale(0.5) -> the parent duration becomes 2 either way (timeScale() recaches ancestors)",
|
|
gsap_calls: &["tl=gsap.timeline({paused:true,smoothChildTiming:true})", "c=tl.to(o,{x:1,duration:1,ease:\"none\"})", "c.timeScale(0.5)"],
|
|
meta: &[],
|
|
t: &[],
|
|
series: &[],
|
|
ops: &[
|
|
&[("op", Val::S("created")), ("tl_duration", Val::F(1.0)), ("c_start", Val::F(0.0)), ("c_end", Val::F(1.0))],
|
|
&[
|
|
("op", Val::S("c.timeScale(0.5)")), ("tl_duration", Val::F(2.0)), ("c_start", Val::F(0.0)), ("c_end", Val::F(2.0)),
|
|
]
|
|
] },
|
|
TimeScaleCase { id: "design_non_smooth_child_timing_duration", description: "design 12.6 smooth_child_timing_recomputes_the_parent (smoothChildTiming:false): child.timeScale(0.5) -> the parent duration becomes 2 either way (timeScale() recaches ancestors)",
|
|
gsap_calls: &["tl=gsap.timeline({paused:true,smoothChildTiming:false})", "c=tl.to(o,{x:1,duration:1,ease:\"none\"})", "c.timeScale(0.5)"],
|
|
meta: &[],
|
|
t: &[],
|
|
series: &[],
|
|
ops: &[
|
|
&[("op", Val::S("created")), ("tl_duration", Val::F(1.0)), ("c_start", Val::F(0.0)), ("c_end", Val::F(1.0))],
|
|
&[
|
|
("op", Val::S("c.timeScale(0.5)")), ("tl_duration", Val::F(2.0)), ("c_start", Val::F(0.0)), ("c_end", Val::F(2.0)),
|
|
]
|
|
] },
|
|
];
|