(&self, time: Option<i64>)
| 573 | } |
| 574 | |
| 575 | pub fn calculate_percent(&self, time: Option<i64>) -> f64 { |
| 576 | let mut percent = 1.0; |
| 577 | let mut props = self.props.borrow_mut(); |
| 578 | |
| 579 | if props.animation_start_time.is_none() { |
| 580 | props.animation_start_time = time |
| 581 | } |
| 582 | |
| 583 | if let Some(time) = time { |
| 584 | let duration = self.options.animation().duration; |
| 585 | if duration > 0 { |
| 586 | percent = (time - props.animation_start_time.unwrap()) as f64 / duration as f64; |
| 587 | } |
| 588 | } |
| 589 | percent |
| 590 | } |
| 591 | } |
| 592 | |
| 593 | impl<'a, C, E, M, D, O> Chart<'a, C, M, D, E> for BaseChart<'a, C, E, M, D, O> |
no test coverage detected