summaryrefslogtreecommitdiff
path: root/tests/auto/declarative_ui
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2017-02-23 18:08:15 +0100
committerPaolo Angelelli <paolo.angelelli@qt.io>2017-03-06 21:09:54 +0000
commit9c2bf32b1185cdfcf448a76dbc4a9ba18ae68b05 (patch)
treeef7338aaaa9198b3d6b2bacd3ae16a11b9079a75 /tests/auto/declarative_ui
parent7a6c1a93a0c1f7305f861b2f717bf71f2c7eaae7 (diff)
downloadqtlocation-9c2bf32b1185cdfcf448a76dbc4a9ba18ae68b05.tar.gz
Optimize QGeoProjectionWebMercator::wrappedMapProjectionToItemPosition
This patch bakes all the required linear transformations performed in the method inside a 4x4 double matrix, removing 4 of the 5 instructions previously performed. Autotest adaptations with compares instead of verifys have been necessary due to small epsilons in the results. Change-Id: I7795173a27812eb93a48e3175ad24fd546aeec04 Reviewed-by: Michal Klocek <michal.klocek@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'tests/auto/declarative_ui')
-rw-r--r--tests/auto/declarative_ui/tst_map_item_details.qml10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/auto/declarative_ui/tst_map_item_details.qml b/tests/auto/declarative_ui/tst_map_item_details.qml
index ebaf1ea7..0c5f5c0b 100644
--- a/tests/auto/declarative_ui/tst_map_item_details.qml
+++ b/tests/auto/declarative_ui/tst_map_item_details.qml
@@ -439,7 +439,7 @@ Item {
// move item edge onto dateline
extMapRectDateline.topLeft.longitude = datelineCoordinate.longitude
point = map.fromCoordinate(extMapRectDateline.topLeft)
- verify(point.x == map.width / 2.0)
+ compare(point.x, map.width / 2.0)
// drag item back onto dateline
verify(LocationTestHelper.waitForPolished(map))
visualInspectionPoint(inspectionTime)
@@ -463,7 +463,7 @@ Item {
verify(extMapCircleDateline.center.longitude === 180)
map.center = datelineCoordinate
point = map.fromCoordinate(extMapCircleDateline.center)
- verify(point.x == map.width / 2.0) // center of the screen
+ compare(point.x, map.width / 2.0) // center of the screen
visualInspectionPoint()
extMapCircleDateline.center.longitude = datelineCoordinateRight.longitude // -170, moving the circle to the right
point = map.fromCoordinate(extMapCircleDateline.center)
@@ -533,12 +533,12 @@ Item {
path[0].longitude = datelineCoordinate.longitude;
extMapPolygonDateline.path = path;
point = map.fromCoordinate(extMapPolygonDateline.path[0])
- verify(point.x == map.width / 2.0)
+ compare(point.x, map.width / 2.0)
path = extMapPolygonDateline.path;
path[3].longitude = datelineCoordinate.longitude;
extMapPolygonDateline.path = path;
point = map.fromCoordinate(extMapPolygonDateline.path[3])
- verify(point.x == map.width / 2.0)
+ compare(point.x, map.width / 2.0)
verify(LocationTestHelper.waitForPolished(map))
visualInspectionPoint(inspectionTime)
mousePress(map, point.x + 5, point.y - 5)
@@ -575,7 +575,7 @@ Item {
path[0].longitude = datelineCoordinate.longitude;
extMapPolylineDateline.path = path;
point = map.fromCoordinate(extMapPolylineDateline.path[0])
- verify(point.x == map.width / 2.0)
+ compare(point.x, map.width / 2.0)
map.removeMapItem(extMapPolylineDateline)
// map route