anim: reduce gif fps
it's brrrring my cpu on my 240hz monitor. we don't need 240hz gifs... Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -15,10 +15,10 @@ pub struct LatextTexture<'a> {
|
||||
/// So we must keep on requesting to repaint at our desired time to ensure our repaint goes through.
|
||||
/// See [`egui::Context::request_repaint_after`]
|
||||
pub fn handle_repaint<'a>(ui: &egui::Ui, latest: LatextTexture<'a>) -> &'a TextureHandle {
|
||||
if let Some(repaint) = latest.request_next_repaint {
|
||||
if let Ok(dur) = repaint.duration_since(SystemTime::now()) {
|
||||
ui.ctx().request_repaint_after(dur);
|
||||
}
|
||||
if let Some(_repaint) = latest.request_next_repaint {
|
||||
// 24fps for gif is fine
|
||||
ui.ctx()
|
||||
.request_repaint_after(std::time::Duration::from_millis(41));
|
||||
}
|
||||
latest.texture
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user