Bladeren bron

Load the image before starting the animation

Change-Id: If3b625139f6943940a2bee8690459d60da8758cd
Donald Carr 9 jaren geleden
bovenliggende
commit
62b1d13ec9
1 gewijzigde bestanden met toevoegingen van 11 en 3 verwijderingen
  1. 11 3
      qml/basic/Basic.qml

+ 11 - 3
qml/basic/Basic.qml

@@ -46,6 +46,9 @@ Item {
                 property int artworkHeight: 0
                 property int compoundArtworkHeight: 0
                 property bool full: artworkHeight > root.height
+                property bool initialized: false
+
+                onFullChanged: initialized = true
 
                 height: childrenRect.height
                 width: parent.width
@@ -79,20 +82,25 @@ Item {
                     }
                     headElement = pictureArray.shift()
                     artworkHeight -= headElement.height
+
+                    while (!full) {
+                        addImage()
+                    }
+
                     artworkStack.y += headElement.height
                 }
 
                 Timer {
                     id: populateTimer
-                    running: !artworkStack.full
+                    running: !artworkStack.initialized
                     repeat: true
-                    interval: 100*Math.random() + 100
+                    interval: 100
                     onTriggered: artworkStack.addImage()
                 }
 
                 Timer {
                     id: deathTimer
-                    running: artworkStack.full
+                    running: artworkStack.initialized
                     repeat: true
                     interval: globalVars.adjustedInterval
                     onTriggered: artworkStack.shift()