Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-84375

Animation without 'from' value set and loops > 1 slows down at the end

    XMLWordPrintable

Details

    • cc49e68bdf (qt/qtdeclarative/dev) cc49e68bdf (qt/tqtc-qtdeclarative/dev) 684645ea52 (qt/qtdeclarative/6.3) 684645ea52 (qt/tqtc-qtdeclarative/6.3) 684645ea52 (qt/tqtc-qtdeclarative/6.3.1)

    Description

      Attached application has infinite loops and when it is on the last frame of the animation, it seems to start the next run and reads the current 'from' value from the item and starts another loop from that value of the last frame to the actual end. This causes it to slow down more and more until it eventually gets to from==to and stops.

      It probably doesn't make any sense have loops > 1 without setting 'from', but I don't think the behavior with the last frame of the animation should slow down.

      At least some error/warning could be printed that this doesn't make sense, and/or just have the same behavior as loops==1.

      import QtQuick 2.12
      import QtQuick.Window 2.12
      
      Window {
          visible: true
          width: 640
          height: 480
      
          NumberAnimation {
      //        from: 90
              to: from+360
      //        loops: Animation.Infinite
              target: rect
              properties: "rotation"
              running: true
              duration: 1000
          }
      
          Rectangle {
              id: rect
              width: 300
              height: 10
              color: "red"
              anchors.centerIn: parent
              transformOrigin: Item.Center
              onRotationChanged: console.log("rotation changed to", rotation)
          }
      }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            ivan.solovev Ivan Solovev
            poikelin Joni Poikelin
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes