mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
map-widget: interrupt map animations on new interactions
When the map is performing zoom/pan animation and the user performs an action that would trigger a new zoom/pan animation, but some glitches can occurs. An example would be when one clicks a dive in the dive list - the zoom/pan animation will trigger, so that the map is centered on the dive site, but if the user clicks the [+] button to zoom-in, while the animation is running the map will glitch. This patch prevents such glitches by stopping all running animations in progress when the user: - single clicks the map - uses the mouse-wheel to zoom - presses the [+] / [-] buttons Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
parent
8bc61f42cb
commit
fe69b304b2
1 changed files with 4 additions and 0 deletions
|
@ -128,6 +128,8 @@ Item {
|
|||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onPressed: { map.stopZoomAnimations(); mouse.accepted = false }
|
||||
onWheel: { map.stopZoomAnimations(); wheel.accepted = false }
|
||||
onDoubleClicked: map.doubleClickHandler(map.toCoordinate(Qt.point(mouseX, mouseY)))
|
||||
}
|
||||
|
||||
|
@ -294,6 +296,7 @@ Item {
|
|||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
map.stopZoomAnimations()
|
||||
map.newCenter = map.center
|
||||
map.newZoom = map.zoomLevel + map.zoomStep
|
||||
if (map.newZoom > map.maximumZoomLevel)
|
||||
|
@ -318,6 +321,7 @@ Item {
|
|||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
map.stopZoomAnimations()
|
||||
map.newCenter = map.center
|
||||
map.newZoom = map.zoomLevel - map.zoomStep
|
||||
mapAnimationClick.restart()
|
||||
|
|
Loading…
Reference in a new issue