From 41793861b5400257325f1792e321b577bb6ce873 Mon Sep 17 00:00:00 2001 From: Roope Salmi Date: Mon, 19 Apr 2021 14:15:33 +0300 Subject: [PATCH] =?UTF-8?q?Ruma=20v=C3=A4liaikainen=20korjaus=20Windowsill?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/demo.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/examples/demo.rs b/examples/demo.rs index 3c502a1..78063a3 100644 --- a/examples/demo.rs +++ b/examples/demo.rs @@ -142,8 +142,14 @@ use femtovg::{renderer::OpenGl, Canvas, Color, Paint, Path}; impl Widget for Plot { type Ret = Entity; - fn on_build(&mut self, _state: &mut State, entity: Entity) -> Self::Ret { + fn on_build(&mut self, state: &mut State, entity: Entity) -> Self::Ret { //state.style.insert_element(entity, "element"); + let animation = AnimationState::new() + .with_duration(std::time::Duration::from_secs(30000000)) + .with_keyframe((0.0, Stretch(0.0))) + .with_keyframe((0.0, Stretch(5.))); + let animation = state.style.border_width.insert_animation(animation); + state.style.border_width.play_animation(entity, animation); entity } fn on_draw(&mut self, state: &mut State, entity: Entity, canvas: &mut Canvas) {