Always use double point precision for geo lookups internally
authorErik Mattsson <erik.mattsson@appello.com>
Mon, 4 Nov 2013 13:52:22 +0000 (14:52 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Wed, 6 Nov 2013 00:18:02 +0000 (01:18 +0100)
commite63de105fe71a0d825f8c82c75f17f65614aeb03
tree4bcd1bfdb12431d21179d5bfd2495630a1203fe6
parent3fa4c43b5285d628084c74354e82ea0ee981d3f1
Always use double point precision for geo lookups internally

This patch is to remedy rounding errors on ARM devices where
qreal is defined as a float instead of double.

The main change is to replace QPointF with QDoubleVector2D when using
screenPositionToCoordinate and coordinateToScreenPosition. In many
cases the QDoubleVector2D is converted to QPointF when the increased
precision is not used. This because many of the surounding classes uses
qreal so the precsision would be lost anyway. These classes include
QVectorPath, QPainterPath and QQuickItem.

The most important change is in polyline and polygon map item in the
updateSourcePoints methods. Using floating point precision here resulted
in many precision errors that caused for example route lines to be
chopped of as the method erroneously thought it needed to wrap to the other
side of the datum line.

The external uses of the coordinate lookup functions in declarative geo map
has been left untouched so they still use QPointF for compatibility reasons. Not
sure how the process goes when updating externally visible parts of the API

Change-Id: I01ed67a0563cfb5c4ff2db6395b7a62eaa8e4a19
Reviewed-by: Aaron McCarthy <mccarthy.aaron@gmail.com>
20 files changed:
src/imports/location/qdeclarativecirclemapitem.cpp
src/imports/location/qdeclarativegeomap.cpp
src/imports/location/qdeclarativegeomapgesturearea.cpp
src/imports/location/qdeclarativegeomapitembase.cpp
src/imports/location/qdeclarativegeomapquickitem.cpp
src/imports/location/qdeclarativepolygonmapitem.cpp
src/imports/location/qdeclarativepolylinemapitem.cpp
src/imports/location/qdeclarativerectanglemapitem.cpp
src/imports/location/qgeomapitemgeometry.cpp
src/location/maps/qgeomap.cpp
src/location/maps/qgeomap_p.h
src/location/maps/qgeomapdata_p.h
src/location/maps/qgeomapscene.cpp
src/location/maps/qgeomapscene_p.h
src/location/maps/qgeotiledmapdata.cpp
src/location/maps/qgeotiledmapdata_p.h
src/location/maps/qgeotiledmapdata_p_p.h
src/positioning/qdoublevector2d.cpp
src/positioning/qdoublevector2d_p.h
tests/auto/qgeomapscene/tst_qgeomapscene.cpp