Skip to content
Snippets Groups Projects
Commit b8a3cc81 authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

also allow the first keyframe

parent b1905755
No related branches found
No related tags found
No related merge requests found
......@@ -24,6 +24,10 @@ impl MediaTime {
pub fn from_seconds(timestamp: i64) -> MediaTime {
MediaTime(time::Duration::seconds(timestamp))
}
pub fn is_zero(&self) -> bool {
self.0.is_zero()
}
}
impl std::fmt::Display for MediaTime {
......
......@@ -85,7 +85,7 @@ impl SpritesheetManager {
}
pub fn fulfils_frame_interval(&self, timestamp: MediaTime) -> bool {
timestamp - self.last_timestamp > self.frame_interval
self.current_image == 0 || timestamp - self.last_timestamp > self.frame_interval
}
pub fn add_image(&mut self, timestamp: MediaTime, image: RgbImage) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment