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:
justinjohn0306
2026-10-12 17:59:59 +05:30
co-authored by Claude Opus 5.5
parent 0ec0cc5e81
commit bd61308cf9
6 changed files with 69 additions and 8 deletions
+9
View File
@@ -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,
}
}
+12
View File
@@ -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:?}");
}
}
+2 -1
View File
@@ -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,