[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,11 +250,13 @@ SilicaFlickable {
} }
function scrollToPage(index) { function scrollToPage(index) {
if (currentIndex !== index) {
dragScrollAnimation.from = contentX dragScrollAnimation.from = contentX
dragScrollAnimation.to = (width + spacing) * index dragScrollAnimation.to = contentX + (width + spacing) * (index - currentIndex)
dragScrollAnimation.start() dragScrollAnimation.start()
} }
} }
}
function dropItem() { function dropItem() {
if (draggedItem && dragItem.shelfIndex !== currentShelfIndex && currentShelf) { if (draggedItem && dragItem.shelfIndex !== currentShelfIndex && currentShelf) {