summaryrefslogtreecommitdiffstats
path: root/Documentation/50-pot
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2017-08-08 02:10:23 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-08-10 09:08:28 -0700
commitf21ae69f7be799fe710b55f17f9404d803be9487 (patch)
tree1d59695f295db039acc8c68fa2c05932b6e710bb /Documentation/50-pot
parent514c298600956ae416fdf42046ffde2772e844c7 (diff)
downloadsubsurface-f21ae69f7be799fe710b55f17f9404d803be9487.tar.gz
mapwidget.qml: more improvements for the dynamic zoom-in/out
The QML Map has a couple of methods - toCoordinate(someQPointF) and fromCoordinate(someQGeoCoordinate). Ideally, if one passes a point to toCoordinate() and then attempts to convert the resulted coordinates back to the point, the same point in the Map view port with minimal error should be retrieved. That's not always the case - e.g. near 47.400200 -123.142066, which means that the methods are not exactly *reliable* and there might be Map class bugs at hand. The new zoom-in and zoom-out improvements try to work around the above: - for both centerOnRectangle() and centerOnCoordinate(), if no good zoom-out level is found (newZoomOut), the zoom-out is set to the default value of defaultZoomOut. In practice, this prevents the case where the map does not zoom-out at all when going from one place to another - centerOnRectangle() now uses rectangle diagonals to estimate a fit, instead of checking if 2 points (top-left and bottom-right) are visible in the viewport. The usage of fromCoordinate() was giving bad results in this case and comparing distances (diagonals) is more reliable but more expensive on the CPU. Due to the inconsistencies of toCoordinate() and fromCoordinate() the dynamic zoom-in and zoom-out are still not ideal, but the current implementation is somewhat usable with decent accuracy. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Diffstat (limited to 'Documentation/50-pot')
0 files changed, 0 insertions, 0 deletions