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

Proposed by SirVer
Status: Merged
Merged at revision: 8257
Proposed branch: lp:~widelands-dev/widelands/use_correct_zoom
Merge into: lp:widelands
Diff against target: 16 lines (+3/-2)
1 file modified
src/wui/mapview.cc (+3/-2)
To merge this branch: bzr merge lp:~widelands-dev/widelands/use_correct_zoom
Reviewer Review Type Date Requested Status
GunChleoc Approve
Review via email: mp+315330@code.launchpad.net

Commit message

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

To post a comment you must log in.
Revision history for this message
GunChleoc (gunchleoc) wrote :

Code LGTM. Tested and this fixes the bug.

I am in favour of aborting the movement though as the bzr reporter suggested, and also of slowing down the movement. It is making me motion sick.

Let's wait for Travis then merge this one, because it's already an improvement.

review: Approve
Revision history for this message
GunChleoc (gunchleoc) wrote :

bzr reporter -> bug reporter *lol

Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 1856. State: passed. Details: https://travis-ci.org/widelands/widelands/builds/194399423.
Appveyor build 1693. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_use_correct_zoom-1693.

Revision history for this message
GunChleoc (gunchleoc) wrote :

@bunnybot merge

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== 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 @@
441}441}
442442
443void MapView::scroll_to_map_pixel(const Vector2f& pos, const Transition& transition) {443void MapView::scroll_to_map_pixel(const Vector2f& pos, const Transition& transition) {
444 const Rectf area = view_area().rect();444 const TimestampedView current = animation_target_view();
445 const Rectf area = get_view_area(current.view, get_w(), get_h());
445 const Vector2f target_view = pos - Vector2f(area.w / 2.f, area.h / 2.f);446 const Vector2f target_view = pos - Vector2f(area.w / 2.f, area.h / 2.f);
446 set_view(View{target_view, view_.zoom}, transition);447 set_view(View{target_view, current.view.zoom}, transition);
447}448}
448449
449MapView::ViewArea MapView::view_area() const {450MapView::ViewArea MapView::view_area() const {

Subscribers

People subscribed via source and target branches

to status/vote changes: