From 1bc91bfb670c927fff3af53fa5b941824e27f3e8 Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Mon, 27 Nov 2017 16:09:49 +0200 Subject: 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 --- map-widget/qml/MapWidget.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'map-widget/qml') 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 } } } -- cgit v1.2.3-70-g09d2