···4747nanoid = "0.4.0"
4848console = { version = "0.15.8", features = ["windows-console-colors"] }
4949backtrace = "0.3.71"
5050+slug = "0.1.5"
505151525253[dev-dependencies]
+4-1
src/animation.rs
···11use std::fmt::Display;
2233-use crate::Canvas;
33+use crate::{Canvas, Layer};
4455/// Arguments: animation progress (from 0.0 to 1.0), canvas, current ms
66pub type AnimationUpdateFunction = dyn Fn(f32, &mut Canvas, usize) -> anyhow::Result<()>;
77+88+/// An animation that only manipulates a single layer. The layer's render cache is automatically flushed at the end. See `AnimationUpdateFunction` for more information.
99+pub type LayerAnimationUpdateFunction = dyn Fn(f32, &mut Layer, usize) -> anyhow::Result<()>;
710811pub struct Animation {
912 pub name: String,