1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
//! Repro for timed-cascade animations.
//!
//! Three sequential entrance animations on slide 1:
//! 1. fade_in (OnClick)
//! 2. fade_in().after_previous().delay(500)
//! 3. fade_in().after_previous().delay(500)
//!
//! Expected (matching hand-authored timing.pptx):
//! - One outer <p:par> wraps all three effects (one click triggers the cascade)
//! - All three share the same grpId
//! - Effects 2/3 use nodeType="afterEffect"
//! - Left-arrow rewinds the cascade to slide start
//!
//! Open in PowerPoint: there should be NO repair prompt. Run slideshow,
//! click once on slide 1 — all three should appear in sequence. Then
//! press LEFT to test rewind.
use deckmint::objects::shape::ShapeOptionsBuilder;
use deckmint::objects::text::TextOptionsBuilder;
use deckmint::{AnimationEffect, Presentation, ShapeType};
fn main() {
let mut pres = Presentation::new();
let s = pres.add_slide();
s.add_text(
"1 click → 3 effects cascade. Then LEFT to rewind.",
TextOptionsBuilder::new()
.bounds(0.5, 0.3, 9.0, 0.7)
.font_size(22.0)
.bold()
.build(),
);
s.add_text(
"Effect 1 (OnClick)",
TextOptionsBuilder::new()
.bounds(1.0, 1.5, 4.0, 0.6)
.font_size(18.0)
.animation(AnimationEffect::fade_in())
.build(),
);
s.add_shape(
ShapeType::Rect,
ShapeOptionsBuilder::new()
.bounds(1.0, 2.5, 3.0, 1.0)
.fill_color("#4472C4")
.animation(AnimationEffect::fade_in().after_previous().delay(500))
.build(),
);
s.add_shape(
ShapeType::Ellipse,
ShapeOptionsBuilder::new()
.bounds(1.0, 4.0, 3.0, 1.0)
.fill_color("#70AD47")
.animation(AnimationEffect::fade_in().after_previous().delay(500))
.build(),
);
let s = pres.add_slide();
s.add_text(
"Slide 2 — left-arrow from here should rewind to slide 1.",
TextOptionsBuilder::new()
.bounds(0.5, 1.0, 9.0, 2.0)
.font_size(18.0)
.build(),
);
pres.write_to_file("test_after_previous.pptx").unwrap();
println!("Wrote test_after_previous.pptx");
}