mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
parent
ad92d4deb0
commit
52c965fb6d
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user