fix z-level spinner

This commit is contained in:
Dustin Carlino 2020-08-07 11:28:00 -07:00
parent 62ed91925a
commit ec756b5167
2 changed files with 6 additions and 3 deletions

View File

@ -85,6 +85,7 @@ impl WidgetImpl for Spinner {
self.current -= 1;
}
ctx.no_op_event(true, |ctx| self.down.event(ctx, output));
return;
}
if let Some(pt) = ctx.canvas.get_cursor_in_screen_space() {
@ -92,9 +93,11 @@ impl WidgetImpl for Spinner {
if let Some((_, dy)) = ctx.input.get_mouse_scroll() {
if dy > 0.0 && self.current != self.high {
self.current += 1;
output.outcome = Outcome::Changed;
}
if dy < 0.0 && self.current != self.low {
self.current -= 1;
output.outcome = Outcome::Changed;
}
}
}

View File

@ -193,13 +193,13 @@ impl Minimap {
app.unzoomed_agents.bikes = self.composite.is_checked("Bike");
app.unzoomed_agents.buses_and_trains = self.composite.is_checked("Bus");
app.unzoomed_agents.peds = self.composite.is_checked("Pedestrian");
if self.composite.has_widget("zorder") {
app.primary.show_zorder = self.composite.spinner("zorder");
}
self.composite = make_minimap_panel(ctx, app, self.zoom_lvl);
}
_ => {}
}
if self.composite.has_widget("zorder") {
app.primary.show_zorder = self.composite.spinner("zorder");
}
if self.zoomed {
let inner_rect = self.composite.rect_of("minimap");