fix laggy info panel circles

This commit is contained in:
Dustin Carlino 2020-02-25 17:41:24 -08:00
parent 34b1f342a2
commit cc17d9eafd

View File

@ -214,9 +214,15 @@ impl State for SandboxMode {
}
}
if let Some(ref mut s) = self.controls.speed {
if let Some(t) = s.event(ctx, ui, Some(&self.gameplay_mode)) {
return t;
}
}
// Fragile ordering. Don't call this before all the per_obj actions have been called. But
// also let this work before tool_panel, so Key::Escape from the info panel beats the one
// to quit.
// to quit. And let speed update the sim before we update the info panel.
if let Some(ref mut c) = self.controls.common {
if let Some(t) = c.event(ctx, ui, self.controls.speed.as_mut()) {
return t;
@ -227,12 +233,6 @@ impl State for SandboxMode {
tp.event(ctx, ui);
}
if let Some(ref mut s) = self.controls.speed {
if let Some(t) = s.event(ctx, ui, Some(&self.gameplay_mode)) {
return t;
}
}
if let Some(ref mut tp) = self.controls.tool_panel {
match tp.event(ctx, ui) {
Some(WrappedOutcome::Transition(t)) => {