mirror of https://codeberg.org/topola/topola.git
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:
parent
c06180b659
commit
ba5a254e11
|
|
@ -55,7 +55,13 @@ impl Viewport {
|
||||||
menu_bar.multilayer_autoroute_options.planar.principal_layer,
|
menu_bar.multilayer_autoroute_options.planar.principal_layer,
|
||||||
),
|
),
|
||||||
pointer_pos: latest_point,
|
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(
|
workspace.advance_state_by_dt(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue