Make zooming in then back out return to the previous zoom level

This commit is contained in:
Treeco 2020-11-22 22:35:31 +00:00 committed by Joshua Barretto
parent deda202b5a
commit 8922fd949f

View File

@ -308,8 +308,8 @@ impl<'a> Widget for Map<'a> {
.map(|scroll| scroll.y)
.sum();
let new_zoom_lvl = (self.global_state.settings.gameplay.map_zoom
* (1.0 + scrolled * 0.05 * PLATFORM_FACTOR))
.clamped(0.75, max_zoom / 64.0);
* (scrolled * 0.05 * PLATFORM_FACTOR).exp2())
.clamped(0.75, max_zoom / 64.0);
events.push(Event::MapZoom(new_zoom_lvl as f64));
// Icon settings
// Alignment