Fix burst of extra repaints before request_repaint_after deadlines (#8595)

This commit is contained in:
Makro authored and GitHub committed 2026-09-21 06:13:11 +00:00
1 parent e44f9f60d9
commit 9fbd2bcf5e
1 file changed
+1 -6
+1 -6
View File
@@ -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.