This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

🔥 Remove .animate_layer

Was only there as a convenience for auto-flushing the (now long-gone) render cache

-22
-21
src/video/animation.rs
··· 8 8 pub type AnimationUpdateFunction = 9 9 dyn Fn(f32, &mut Canvas, usize) -> anyhow::Result<()> + Send + Sync; 10 10 11 - /// An animation that only manipulates a single layer. See `AnimationUpdateFunction` for more information. 12 - pub type LayerAnimationUpdateFunction = 13 - dyn Fn(f32, &mut Layer, usize) -> anyhow::Result<()> + Send + Sync; 14 - 15 11 pub struct Animation { 16 12 pub name: String, 17 13 // pub keyframes: Vec<Keyframe<C>>, ··· 102 98 easing.into(), 103 99 Animation::new(format!("unnamed animation {}", nanoid!()), f), 104 100 ); 105 - } 106 - 107 - pub fn animate_layer( 108 - &mut self, 109 - layer: &'static str, 110 - duration: usize, 111 - f: &'static LayerAnimationUpdateFunction, 112 - ) { 113 - let animation = Animation { 114 - name: format!("unnamed animation {}", nanoid!()), 115 - update: Box::new(move |progress, canvas, ms| { 116 - (f)(progress, canvas.layer_unchecked(layer), ms)?; 117 - Ok(()) 118 - }), 119 - }; 120 - 121 - self.start_animation(duration, easings::EaseInOutQuadradic, animation); 122 101 } 123 102 }
-1
src/video/hooks.rs
··· 1 - use super::animation::LayerAnimationUpdateFunction; 2 1 use super::context::Context; 3 2 use crate::animation::AnimationUpdateFunction; 4 3 use crate::synchronization::audio::MusicalDurationUnit;