[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1818494-workaround-math-clamp-zoom-everywhere into lp:widelands

2019-03-31 Thread GunChleoc
GunChleoc has proposed merging 
lp:~widelands-dev/widelands/bug-1818494-workaround-math-clamp-zoom-everywhere 
into lp:widelands.

Commit message:
Use math::clamp to ensure that zoom will stay within range.

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1818494 in widelands: "Crash on "Reset zoom" bzr9005-201903031251 
(Release)"
  https://bugs.launchpad.net/widelands/+bug/1818494

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug-1818494-workaround-math-clamp-zoom-everywhere/+merge/365321

I'm no sure whether this actually fixes or only masks the bug. We might only 
want this in the Build 20 branch, hoping that it will prevent crashes there.
-- 
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/bug-1818494-workaround-math-clamp-zoom-everywhere 
into lp:widelands.
=== modified file 'src/wui/mapview.cc'
--- src/wui/mapview.cc	2019-03-25 10:46:23 +
+++ src/wui/mapview.cc	2019-03-31 15:40:28 +
@@ -123,7 +123,8 @@
 std::deque* plan) {
 	for (int i = 1; i < kNumKeyFrames - 2; i++) {
 		float dt = (duration_ms / kNumKeyFrames) * i;
-		const float zoom = zoom_t.value(dt);
+		// Using math::clamp as a workaround for https://bugs.launchpad.net/widelands/+bug/1818494
+		const float zoom = math::clamp(zoom_t.value(dt), 1.f / kMaxZoom, kMaxZoom);
 		const Vector2f center_point = center_point_t.value(dt);
 		const Vector2f viewpoint = center_point - Vector2f(width * zoom / 2.f, height * zoom / 2.f);
 		plan->push_back(MapView::TimestampedView{
@@ -392,6 +393,8 @@
 			return;
 		}
 		view_ = target_view;
+		// Using math::clamp as a workaround for https://bugs.launchpad.net/widelands/+bug/1818494
+		view_.zoom = math::clamp(view_.zoom, 1.f / kMaxZoom, kMaxZoom);
 		MapviewPixelFunctions::normalize_pix(map_, &view_.viewpoint);
 		changeview();
 		return;

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1818494-workaround-math-clamp-zoom-everywhere into lp:widelands

2019-03-31 Thread bunnybot
Continuous integration builds have changed state:

Travis build 4661. State: passed. Details: 
https://travis-ci.org/widelands/widelands/builds/513789175.
Appveyor build 4448. State: success. Details: 
https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_bug_1818494_workaround_math_clamp_zoom_everywhere-4448.
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1818494-workaround-math-clamp-zoom-everywhere/+merge/365321
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/bug-1818494-workaround-math-clamp-zoom-everywhere 
into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1818494-workaround-math-clamp-zoom-everywhere into lp:widelands

2019-03-31 Thread GunChleoc
We now have a protocol in the bug and it looks like this fix is OK, so let's 
have it in trunk ASAP.
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1818494-workaround-math-clamp-zoom-everywhere/+merge/365321
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/bug-1818494-workaround-math-clamp-zoom-everywhere 
into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Build #16547600] amd64 build of widelands 1:19-1-1~ubuntu19.04.1 in ubuntu disco RELEASE [~widelands-dev/ubuntu/widelands]

2019-03-31 Thread Launchpad Buildd System


 * Source Package: widelands
 * Version: 1:19-1-1~ubuntu19.04.1
 * Architecture: amd64
 * Archive: ~widelands-dev/ubuntu/widelands
 * Component: main
 * State: Failed to build
 * Duration: 8 minutes
 * Build Log: 
https://launchpad.net/~widelands-dev/+archive/ubuntu/widelands/+build/16547600/+files/buildlog_ubuntu-disco-amd64.widelands_1%3A19-1-1~ubuntu19.04.1_BUILDING.txt.gz
 * Builder: https://launchpad.net/builders/lgw01-amd64-038
 * Source: not available



If you want further information about this situation, feel free to
contact us by asking a question on Launchpad
(https://answers.launchpad.net/launchpad/+addquestion).

-- 
amd64 build of widelands 1:19-1-1~ubuntu19.04.1 in ubuntu disco RELEASE
https://launchpad.net/~widelands-dev/+archive/ubuntu/widelands/+build/16547600

You are receiving this email because your team Widelands Developers is
the owner of this archive.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Build #16547601] i386 build of widelands 1:19-1-1~ubuntu19.04.1 in ubuntu disco RELEASE [~widelands-dev/ubuntu/widelands]

2019-03-31 Thread Launchpad Buildd System


 * Source Package: widelands
 * Version: 1:19-1-1~ubuntu19.04.1
 * Architecture: i386
 * Archive: ~widelands-dev/ubuntu/widelands
 * Component: main
 * State: Failed to build
 * Duration: 17 minutes
 * Build Log: 
https://launchpad.net/~widelands-dev/+archive/ubuntu/widelands/+build/16547601/+files/buildlog_ubuntu-disco-i386.widelands_1%3A19-1-1~ubuntu19.04.1_BUILDING.txt.gz
 * Builder: https://launchpad.net/builders/lcy01-amd64-025
 * Source: not available



If you want further information about this situation, feel free to
contact us by asking a question on Launchpad
(https://answers.launchpad.net/launchpad/+addquestion).

-- 
i386 build of widelands 1:19-1-1~ubuntu19.04.1 in ubuntu disco RELEASE
https://launchpad.net/~widelands-dev/+archive/ubuntu/widelands/+build/16547601

You are receiving this email because your team Widelands Developers is
the owner of this archive.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp