-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathanimation_demo.rs
46 lines (44 loc) · 1.17 KB
/
animation_demo.rs
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
/*
use ribir::prelude::*;
use std::time::Duration;
fn main() {
let style = PathPaintStyle::Stroke(StrokeOptions::default());
let lyon_path = include_svg!("./Logo.svg");
let mut paths = vec![];
lyon_path.paths.into_iter().for_each(|render_path| {
paths.push(PathPaintKit {
path: render_path.path,
brush: render_path.brush.map_or(Brush::Color(Color::BLACK), |b| b),
style,
});
});
let w = widget! {
PathsPaintKit {
anchor: Anchor::left_top(100., 100.),
transform: Transform::scale(0.5, 0.5),
id: path_widget,
paths,
on_mounted: move |_| circle_animate.run(),
}
Animate {
id: circle_animate,
transition: Transition {
delay: None,
duration: Duration::from_millis(5000),
easing: easing::LINEAR,
repeat: Some(f32::MAX),
},
prop: prop!(path_widget.paths, PathPaintKit::paths_lerp_fn(prop!(path_widget.paths))),
from: vec![
PathPaintKit {
path: Path::rect(&Rect::zero()),
brush: Brush::Color(Color::WHITE),
style
}
]
}
};
App::run(w);
}
*/
fn main() { panic!("Blocked by path sampler finished.") }