1
1
mirror of https://github.com/wez/wezterm.git synced 2024-09-21 03:39:16 +03:00

minor optimization for single-frame animated formats

Use 1-day duration for the single frame when an animated
format yields only a single frame.
This commit is contained in:
Wez Furlong 2023-03-20 10:14:17 -07:00
parent 829e5c15cf
commit 001a49be4c
No known key found for this signature in database
GPG Key ID: 7A7F66A31EC9B387

View File

@ -384,6 +384,12 @@ impl FrameState {
self.current_frame.duration = Duration::from_secs(86400);
self.frames.push(self.current_frame.clone());
false
} else if self.frames.len() == 1 {
// If there's only a single frame, we may as well ensure
// that it has a long duration so that we don't waste
// resources ticking to the same frame over and over
self.frames[0].duration = Duration::from_secs(86400);
true
} else {
true
}