diff options
Diffstat (limited to 'src/animation')
| -rw-r--r-- | src/animation/mod.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/animation/mod.rs b/src/animation/mod.rs index 7984b0d9..d8e8cbd5 100644 --- a/src/animation/mod.rs +++ b/src/animation/mod.rs @@ -261,6 +261,16 @@ impl Animation { pub fn from(&self) -> f64 { self.from } + + pub fn offset(&mut self, offset: f64) { + self.from += offset; + self.to += offset; + + if let Kind::Spring(spring) = &mut self.kind { + spring.from += offset; + spring.to += offset; + } + } } impl Curve { |
