diff options
author | Lubomir I. Ivanov <neolit123@gmail.com> | 2017-11-27 16:09:49 +0200 |
---|---|---|
committer | Lubomir I. Ivanov <neolit123@gmail.com> | 2017-11-27 22:59:22 +0100 |
commit | 1bc91bfb670c927fff3af53fa5b941824e27f3e8 (patch) | |
tree | fff094ab88237cf6ba70ee5e66c7aeff37754c6e /map-widget | |
parent | f39e9001862f0550bc126d5fa0cd57a16657f755 (diff) | |
download | subsurface-1bc91bfb670c927fff3af53fa5b941824e27f3e8.tar.gz |
mapwidget.qml: make pan and zoom-in have the same duration
There was a problem with the current different duration
for pan and zoom. Ideally the pan should before the zoom:
Map zooms out -> pan to new center starts -> zoom in
The problem with this is that if the map pans out too much it
loses it's center and the above scheme would not work.
To solve the problem, make the duration of pan and zoom
the same this is not idea, but prevents the case where
the map would not zoom-in at the correct center.
Also remove the easing function.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Diffstat (limited to 'map-widget')
-rw-r--r-- | map-widget/qml/MapWidget.qml | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/map-widget/qml/MapWidget.qml b/map-widget/qml/MapWidget.qml index 2a75d4080..0961edb86 100644 --- a/map-widget/qml/MapWidget.qml +++ b/map-widget/qml/MapWidget.qml @@ -104,9 +104,9 @@ Item { target: map; property: "zoomLevel"; to: map.newZoomOut; duration: Math.abs(map.newZoomOut - map.zoomLevel) * 200 } ParallelAnimation { - CoordinateAnimation { target: map; property: "center"; to: map.newCenter; duration: 1000 } + CoordinateAnimation { target: map; property: "center"; to: map.newCenter; duration: 2000; easing.type: Easing.OutCubic } NumberAnimation { - target: map; property: "zoomLevel"; to: map.newZoom ; duration: 2000; easing.type: Easing.InCubic + target: map; property: "zoomLevel"; to: map.newZoom; duration: 2000 } } } |