animation: Add more getters
Browse files at this commit4a4c972ffb900951b65fb5317b62c592bbccfc44Parent: ba933771 changed file +12 -1
- src/animation/mod.rs +12 -1
src/animation/mod.rsmodified+12 -1
| @@ -295,11 +295,22 @@ impl Animation { | |||
| 295 | self.to | 295 | self.to |
| 296 | } | 296 | } |
| 297 | 297 | ||
| 298 | - #[cfg(test)] | ||
| 299 | pub fn from(&self) -> f64 { | 298 | pub fn from(&self) -> f64 { |
| 300 | self.from | 299 | self.from |
| 301 | } | 300 | } |
| 302 | 301 | ||
| 302 | + pub fn start_time(&self) -> Duration { | ||
| 303 | + self.start_time | ||
| 304 | + } | ||
| 305 | + | ||
| 306 | + pub fn end_time(&self) -> Duration { | ||
| 307 | + self.start_time + self.duration | ||
| 308 | + } | ||
| 309 | + | ||
| 310 | + pub fn duration(&self) -> Duration { | ||
| 311 | + self.duration | ||
| 312 | + } | ||
| 313 | + | ||
| 303 | pub fn offset(&mut self, offset: f64) { | 314 | pub fn offset(&mut self, offset: f64) { |
| 304 | self.from += offset; | 315 | self.from += offset; |
| 305 | self.to += offset; | 316 | self.to += offset; |