mirror of
https://github.com/storytold/deckcraft.git
synced 2026-10-24 10:37:03 -06:00
Animations: nine PowerPoint exit effects import as themselves (#147)
Exit effects DeckCraft had no entry for (Peek Out, Strips, Blinds, Box, Checkerboard, Diamond, Sink Down, Spinner, Contract) imported as a plain Fade and lost their direction, so a Peek Out or Sink Down didn't move. Each mirrors an entrance DeckCraft already plays, so it is played as that entrance in reverse (Sink Down as Rise Up, leaving downward); the import keeps PowerPoint's direction and saving writes a matching filter or motion. Float Out now also writes its motion. The preset ids and directions come from PowerPoint: every effect, as entrance and exit, in every direction it accepts, saved and read back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
0ec0cc5e81
commit
bd61308cf9
@@ -44,6 +44,15 @@ pub(crate) fn exit_base(effect: &str) -> &str {
|
||||
"swivelOut" => "swivel",
|
||||
"bounceOut" => "bounce",
|
||||
"dissolveOut" => "dissolve",
|
||||
"blindsOut" => "blinds",
|
||||
"boxOut" => "box",
|
||||
"checkerboardOut" => "checkerboard",
|
||||
"diamondOut" => "diamond",
|
||||
"peekOut" => "peek",
|
||||
"stripsOut" => "strips",
|
||||
"sinkDown" => "rise",
|
||||
"spinnerOut" => "spinner",
|
||||
"contract" => "expand",
|
||||
other => other,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -789,3 +789,15 @@ fn show_follows_links() {
|
||||
assert_eq!(s.follow(&p, &Action::LastViewed, None), LinkJump::None);
|
||||
assert_eq!(s.slide, 3);
|
||||
}
|
||||
|
||||
/// #147: exits PowerPoint plays downward leave downward here too.
|
||||
#[test]
|
||||
fn sink_down_and_peek_out_to_bottom_move_down() {
|
||||
for (effect, option) in [("sinkDown", ""), ("peekOut", "b"), ("floatOut", "d")] {
|
||||
let mut a = anim(1, AnimClass::Exit, effect, AnimStart::OnClick);
|
||||
a.option = option.into();
|
||||
let tl = Timeline::new(&slide_with(vec![a]), W, H);
|
||||
let s = tl.state(ShapeId(1), None, 0, 0.5);
|
||||
assert!(s.offset_y > 0.0, "{effect} {option}: {s:?}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -471,7 +471,8 @@ fn build_spec(a: &Animation, xf: Xfrm, sw: f64, sh: f64, resolve: &dyn Fn(&deckc
|
||||
EffectSpec {
|
||||
class: a.class,
|
||||
effect,
|
||||
option: a.option.clone(),
|
||||
// Sink Down is Rise Up played backwards, leaving downward.
|
||||
option: if a.effect == "sinkDown" { "d".into() } else { a.option.clone() },
|
||||
accel: a.smooth_start,
|
||||
decel: a.smooth_end,
|
||||
bounce: a.bounce_end,
|
||||
|
||||
Reference in New Issue
Block a user