diff --git a/voxygen/src/hud/map.rs b/voxygen/src/hud/map.rs index f2389230ad..7ea03cf1b8 100644 --- a/voxygen/src/hud/map.rs +++ b/voxygen/src/hud/map.rs @@ -327,7 +327,9 @@ impl<'a> Widget for Map<'a> { .sum(); // Drag represents offset of view from the player_pos in chunk coords let drag_new = drag + dragged / map_size / zoom * max_zoom; - events.push(Event::SettingsChange(MapDrag(drag_new))); + if drag_new != drag { + events.push(Event::SettingsChange(MapDrag(drag_new))); + } let rect_src = position::Rect::from_xy_dim( [ @@ -392,10 +394,12 @@ impl<'a> Widget for Map<'a> { .scrolls() .map(|scroll| scroll.y) .sum(); - let new_zoom_lvl = (self.global_state.settings.interface.map_zoom - * (scrolled * 0.05 * -1.0).exp2()) - .clamped(1.25, max_zoom / 64.0); - events.push(Event::SettingsChange(MapZoom(new_zoom_lvl as f64))); + if scrolled != 0.0 { + let new_zoom_lvl = (self.global_state.settings.interface.map_zoom + * (scrolled * 0.05 * -1.0).exp2()) + .clamped(1.25, max_zoom / 64.0); + events.push(Event::SettingsChange(MapZoom(new_zoom_lvl as f64))); + } // Icon settings // Alignment Rectangle::fill_with([150.0, 200.0], color::TRANSPARENT) diff --git a/voxygen/src/hud/minimap.rs b/voxygen/src/hud/minimap.rs index 7eb760a8aa..6eabfb7275 100644 --- a/voxygen/src/hud/minimap.rs +++ b/voxygen/src/hud/minimap.rs @@ -514,6 +514,7 @@ impl<'a> Widget for MiniMap<'a> { // Set the image dimensions here, rather than recomputing each time. zoom = min_zoom.max(zoom / ZOOM_FACTOR); // set_image_dims(zoom); + events.push(Event::SettingsChange(MinimapZoom(zoom))); } if Button::image(self.imgs.mmap_plus) .w_h(18.0 * SCALE, 18.0 * SCALE) @@ -528,6 +529,7 @@ impl<'a> Widget for MiniMap<'a> { { zoom = min_zoom.max(zoom * ZOOM_FACTOR); // set_image_dims(zoom); + events.push(Event::SettingsChange(MinimapZoom(zoom))); } // Always northfacing button @@ -555,8 +557,6 @@ impl<'a> Widget for MiniMap<'a> { events.push(Event::SettingsChange(MinimapFaceNorth(!is_facing_north))); } - events.push(Event::SettingsChange(MinimapZoom(zoom))); - // Coordinates let player_pos = self .client