make sure to draw modal menus last; noticed route preview was covering it

This commit is contained in:
Dustin Carlino 2019-05-08 10:21:44 -07:00
parent 89b74b9137
commit 16c606c745
5 changed files with 6 additions and 6 deletions

View File

@ -140,6 +140,7 @@ impl PolygonDebugger {
// True when done
pub fn event(&mut self, ctx: &mut EventCtx) -> bool {
self.menu.handle_event(ctx, None);
ctx.canvas.handle_event(ctx.input);
if self.menu.action("quit") {
return true;
} else if self.current != self.items.len() - 1 && self.menu.action("next item") {

View File

@ -219,7 +219,6 @@ impl EditMode {
&ShowEverything::new(),
);
common.draw(g, &state.ui);
menu.draw(g);
// TODO Similar to drawing areas with traffic or not -- would be convenient to just
// supply a set of things to highlight and have something else take care of drawing
@ -270,6 +269,8 @@ impl EditMode {
opts.override_colors.insert(ID::Intersection(*i), color);
state.ui.primary.draw_map.get_i(*i).draw(g, &opts, &ctx);
}
menu.draw(g);
}
Mode::Edit(EditMode::Saving(ref wizard))
| Mode::Edit(EditMode::Loading(ref wizard)) => {

View File

@ -260,8 +260,6 @@ impl TrafficSignalEditor {
.ui
.draw(g, opts, &state.ui.primary.sim, &ShowEverything::new());
self.menu.draw(g);
let ctx = DrawCtx {
cs: &state.ui.cs,
map: &state.ui.primary.map,
@ -293,6 +291,7 @@ impl TrafficSignalEditor {
wizard.draw(g);
}
self.menu.draw(g);
CommonState::draw_osd(g, &state.ui);
}
}

View File

@ -321,9 +321,9 @@ impl SandboxMode {
&ShowEverything::new(),
);
mode.common.draw(g, &state.ui);
mode.menu.draw(g);
mode.route_viewer.draw(g, &state.ui);
mode.show_activity.draw(g, &state.ui);
mode.menu.draw(g);
}
},
_ => unreachable!(),

View File

@ -265,12 +265,11 @@ impl AgentSpawner {
opts.override_colors.insert(src, ui.cs.get("selected"));
ui.draw(g, opts, &ui.primary.sim, &ShowEverything::new());
self.menu.draw(g);
if let Some((_, Some(ref trace))) = self.maybe_goal {
g.draw_polygon(ui.cs.get("route"), &trace.make_polygons(LANE_THICKNESS));
}
self.menu.draw(g);
CommonState::draw_osd(g, ui);
}
}