mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-04 22:43:17 +00:00
Fix the changing viewport when zooming with the slider.
This commit is contained in:
parent
3fbc8b2711
commit
17b27b2946
@ -1924,8 +1924,8 @@ void display::set_zoom(int amount, bool absolute)
|
|||||||
zoom_slider->set_value(new_zoom);
|
zoom_slider->set_value(new_zoom);
|
||||||
}
|
}
|
||||||
SDL_Rect const &area = map_area();
|
SDL_Rect const &area = map_area();
|
||||||
xpos_ += (xpos_ + area.w / 2) * amount / zoom_;
|
xpos_ += (xpos_ + area.w / 2) * (absolute ? new_zoom - zoom_ : amount) / zoom_;
|
||||||
ypos_ += (ypos_ + area.h / 2) * amount / zoom_;
|
ypos_ += (ypos_ + area.h / 2) * (absolute ? new_zoom - zoom_ : amount) / zoom_;
|
||||||
|
|
||||||
zoom_ = new_zoom;
|
zoom_ = new_zoom;
|
||||||
bounds_check_position();
|
bounds_check_position();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user