Răsfoiți Sursa

Move from arb timer to animation based driving (thank you Gunnar)

Donald Carr 8 ani în urmă
părinte
comite
37c8897dab
1 a modificat fișierele cu 4 adăugiri și 8 ștergeri
  1. 4 8
      qml/reel/Reel.qml

+ 4 - 8
qml/reel/Reel.qml

@@ -18,6 +18,7 @@ View {
 
     QtObject {
         id: d
+        property real t: 0
         property var priorImage
         property real velocity: 0
         property bool initialized: false
@@ -37,6 +38,9 @@ View {
             var col = columnArray[globalSettings.columnCount - 1]
             priorImage = col.imageArray.shift()
         }
+
+        NumberAnimation on t { from: 0; to: 1; duration: 1000; loops: -1 }
+        onTChanged: { animationStep(); }
     }
 
     Component {
@@ -115,14 +119,6 @@ View {
         }
     }
 
-    // feed
-    Timer {
-        repeat: true
-        running: true
-        interval: 100/6
-        onTriggered: d.animationStep()
-    }
-
     // accel
     Timer {
         repeat: true