From ec756b5167e1475df7fa8fb8cbf5d430b99998aa Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Fri, 7 Aug 2020 11:28:00 -0700 Subject: [PATCH] fix z-level spinner --- ezgui/src/widgets/spinner.rs | 3 +++ game/src/common/minimap.rs | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ezgui/src/widgets/spinner.rs b/ezgui/src/widgets/spinner.rs index 9b10e5f28f..dec1a1ca24 100644 --- a/ezgui/src/widgets/spinner.rs +++ b/ezgui/src/widgets/spinner.rs @@ -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; } } } diff --git a/game/src/common/minimap.rs b/game/src/common/minimap.rs index ee2d13f6cd..4860eb34d0 100644 --- a/game/src/common/minimap.rs +++ b/game/src/common/minimap.rs @@ -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");