fix(topola-egui): Always clamp `dt` to `i.predicted_dt`

`egui` clamps its `i.stable_dt` to `i.predicted_dt` only when egui
requested a repaint during the last frame. I however sometimes
experience severe stuttering, which means that this detection
method is insufficient to ensure smoothness. So, let's clamp `dt` to
`i.predicted_dt` and see if this helps.
This commit is contained in:
Mikolaj Wielgus 2025-10-28 16:05:58 +01:00
parent c06180b659
commit ba5a254e11
1 changed files with 7 additions and 1 deletions

View File

@ -55,7 +55,13 @@ impl Viewport {
menu_bar.multilayer_autoroute_options.planar.principal_layer,
),
pointer_pos: latest_point,
dt: ctx.input(|i| i.stable_dt),
dt: ctx.input(|i| {
if i.stable_dt <= i.predicted_dt {
i.stable_dt
} else {
i.predicted_dt
}
}),
};
workspace.advance_state_by_dt(