[app] Fixed scrolling of storage view on SD card insertion

It was producing strange results if contentX was non-zero
This commit is contained in:
Slava Monich 2020-11-01 17:07:33 +02:00
parent 4e479a3381
commit 5fb0779519

View file

@ -250,9 +250,11 @@ SilicaFlickable {
}
function scrollToPage(index) {
dragScrollAnimation.from = contentX
dragScrollAnimation.to = (width + spacing) * index
dragScrollAnimation.start()
if (currentIndex !== index) {
dragScrollAnimation.from = contentX
dragScrollAnimation.to = contentX + (width + spacing) * (index - currentIndex)
dragScrollAnimation.start()
}
}
}