style: Switch animation timestamps to be doubles instead of floats.

32-bit floats are not enough to hold timestamps since the epoch and
result in jank.
This commit is contained in:
Patrick Walton 2015-08-01 17:14:14 -07:00
parent c6b043582b
commit cac01edf80
4 changed files with 60 additions and 57 deletions

View file

@ -208,15 +208,15 @@ pub struct Animation {
/// A description of the property animation that is occurring.
pub property_animation: PropertyAnimation,
/// The start time of the animation, as returned by `time::precise_time_s()`.
pub start_time: f32,
pub start_time: f64,
/// The end time of the animation, as returned by `time::precise_time_s()`.
pub end_time: f32,
pub end_time: f64,
}
impl Animation {
/// Returns the duration of this animation in seconds.
#[inline]
pub fn duration(&self) -> f32 {
pub fn duration(&self) -> f64 {
self.end_time - self.start_time
}
}