mirror of
https://github.com/storytold/egui.git
synced 2026-11-22 18:41:52 +01:00
Fix burst of extra repaints before request_repaint_after deadlines (#8595)
This commit is contained in:
1 parent
e44f9f60d9
commit
9fbd2bcf5e
1 file changed
+1
-6
@@ -130,7 +130,7 @@ impl ContextImpl {
|
||||
|
||||
fn request_repaint_after(
|
||||
&mut self,
|
||||
mut delay: Duration,
|
||||
delay: Duration,
|
||||
viewport_id: ViewportId,
|
||||
cause: RepaintCause,
|
||||
) {
|
||||
@@ -147,11 +147,6 @@ impl ContextImpl {
|
||||
// Hovering a tooltip is a good example of a case where we want to repaint after a delay.
|
||||
}
|
||||
|
||||
if let Ok(predicted_frame_time) = Duration::try_from_secs_f32(viewport.input.predicted_dt) {
|
||||
// Make it less likely we over-shoot the target:
|
||||
delay = delay.saturating_sub(predicted_frame_time);
|
||||
}
|
||||
|
||||
viewport.repaint.causes.push(cause);
|
||||
|
||||
// We save some CPU time by only calling the callback if we need to.
|
||||
|
||||
Reference in new issue
Block a user