summaryrefslogtreecommitdiff
path: root/src/positioning
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-01-22 09:29:14 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-01-22 09:29:14 +0100
commitd369cf01b5617961c2d0c9db7a7be6c25b42954a (patch)
treebcd31b4ca0edc5c554483f88cc0e9d5dc16e934a /src/positioning
parent9485871222fb3c8f5f2d058ae8c5c0ca13b0ce2c (diff)
parentb17c07dc0b947c979372fbaf558ce9acc07d1837 (diff)
downloadqtlocation-d369cf01b5617961c2d0c9db7a7be6c25b42954a.tar.gz
Merge remote-tracking branch 'origin/5.12' into dev
Conflicts: .qmake.conf Change-Id: I8d0881209c8b0a0dce4ed949ef89ee2679448420
Diffstat (limited to 'src/positioning')
-rw-r--r--src/positioning/qgeorectangle.cpp41
1 files changed, 23 insertions, 18 deletions
diff --git a/src/positioning/qgeorectangle.cpp b/src/positioning/qgeorectangle.cpp
index bb2debcf..80dd41b4 100644
--- a/src/positioning/qgeorectangle.cpp
+++ b/src/positioning/qgeorectangle.cpp
@@ -939,31 +939,36 @@ QGeoRectangle &QGeoRectangle::operator|=(const QGeoRectangle &rectangle)
bool joinWrapLeft = (nonWrapRight >= wrapLeft);
bool joinWrapRight = (nonWrapLeft <= wrapRight);
- if (joinWrapLeft) {
- if (joinWrapRight) {
- left = -180.0;
- right = 180.0;
- } else {
- left = nonWrapLeft;
- right = wrapRight;
- }
+ if (wrapLeft <= nonWrapLeft) { // The wrapping rectangle contains the non-wrapping one entirely
+ left = wrapLeft;
+ right = wrapRight;
} else {
- if (joinWrapRight) {
- left = wrapLeft;
- right = nonWrapRight;
- } else {
- double wrapRightDistance = nonWrapLeft - wrapRight;
- double wrapLeftDistance = wrapLeft - nonWrapRight;
-
- if (wrapLeftDistance == wrapRightDistance) {
+ if (joinWrapLeft) {
+ if (joinWrapRight) {
left = -180.0;
right = 180.0;
- } else if (wrapLeftDistance < wrapRightDistance) {
+ } else {
left = nonWrapLeft;
right = wrapRight;
- } else {
+ }
+ } else {
+ if (joinWrapRight) {
left = wrapLeft;
right = nonWrapRight;
+ } else {
+ double wrapRightDistance = nonWrapLeft - wrapRight;
+ double wrapLeftDistance = wrapLeft - nonWrapRight;
+
+ if (wrapLeftDistance == wrapRightDistance) {
+ left = -180.0;
+ right = 180.0;
+ } else if (wrapLeftDistance < wrapRightDistance) {
+ left = nonWrapLeft;
+ right = wrapRight;
+ } else {
+ left = wrapLeft;
+ right = nonWrapRight;
+ }
}
}
}