← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~widelands-dev/widelands/use_correct_zoom into lp:widelands

 

SirVer has proposed merging lp:~widelands-dev/widelands/use_correct_zoom into lp:widelands.

Commit message:
Use the target zoom instead of the current zoom when planning a moving animation.

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1658533 in widelands: "Issues with the new map-movement feature"
  https://bugs.launchpad.net/widelands/+bug/1658533

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/use_correct_zoom/+merge/315330
-- 
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/use_correct_zoom into lp:widelands.
=== modified file 'src/wui/mapview.cc'
--- src/wui/mapview.cc	2017-01-20 21:25:16 +0000
+++ src/wui/mapview.cc	2017-01-23 08:21:49 +0000
@@ -441,9 +441,10 @@
 }
 
 void MapView::scroll_to_map_pixel(const Vector2f& pos, const Transition& transition) {
-	const Rectf area = view_area().rect();
+	const TimestampedView current = animation_target_view();
+	const Rectf area = get_view_area(current.view, get_w(), get_h());
 	const Vector2f target_view = pos - Vector2f(area.w / 2.f, area.h / 2.f);
-	set_view(View{target_view, view_.zoom}, transition);
+	set_view(View{target_view, current.view.zoom}, transition);
 }
 
 MapView::ViewArea MapView::view_area() const {


Follow ups