Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Strange rescaling at the end of scale animation (Linux only)
Forum Updated to NodeBB v4.3 + New Features

Strange rescaling at the end of scale animation (Linux only)

Scheduled Pinned Locked Moved Solved QML and Qt Quick
animationqt quickqmlscale
3 Posts 2 Posters 688 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Cyna
    wrote on last edited by Cyna
    #1

    Hello,
    I did a simple animation which changes scale of an item and also x and y. It works fine in Windows system but in Ubuntu I can observe strange tick at the end. Moreover it's not reproducible all the time. Is it a bug or it can be fixed somehow? In gif I've attached you can observe that sometimes strange rescaling occured and sometimes not.

    0_1559915062125_gif.gif

            Rectangle {
                x:0
                y:0
                width: 4000
                height: 4000
                anchors.centerIn: parent
                color: "white"
                z: 1
            }
    
            Timer {
                running: true
                repeat: true
                interval: 2000
                onTriggered: {
                    if (funnyRect.state === "ONE") {
                        funnyRect.state = "SECOND"
                    } else {
                        funnyRect.state = "ONE"
                    }
                }
            }
    
            Rectangle {
                id: funnyRect
                x: 1256
                y: 64
                width: 500
                height: 500
                color: "grey"
                z: 2
    
                state: "ONE"
    
                states: [
                    State {
                        name: "ONE"
                        PropertyChanges { target: funnyRect; scale: 1.0}
                        PropertyChanges { target: funnyRect; x: 1256}
                        PropertyChanges { target: funnyRect; y: 64}
                    },
                    State {
                        name: "SECOND"
                        PropertyChanges { target: funnyRect; scale: 0.65}
                        PropertyChanges { target: funnyRect; x: 1331}
                        PropertyChanges { target: funnyRect; y: 174}
                    }
                ]
    
                transitions: [
                    Transition {
                        to: "*"
                        ScaleAnimator   { duration: 1000; easing.type: Easing.InOutCubic }
                        PropertyAnimation { properties: "x,y"; duration: 1000; easing.type: Easing.InOutCubic }
                    }
                ]
            }
    
    KillerSmathK 1 Reply Last reply
    0
    • C Cyna

      Hello,
      I did a simple animation which changes scale of an item and also x and y. It works fine in Windows system but in Ubuntu I can observe strange tick at the end. Moreover it's not reproducible all the time. Is it a bug or it can be fixed somehow? In gif I've attached you can observe that sometimes strange rescaling occured and sometimes not.

      0_1559915062125_gif.gif

              Rectangle {
                  x:0
                  y:0
                  width: 4000
                  height: 4000
                  anchors.centerIn: parent
                  color: "white"
                  z: 1
              }
      
              Timer {
                  running: true
                  repeat: true
                  interval: 2000
                  onTriggered: {
                      if (funnyRect.state === "ONE") {
                          funnyRect.state = "SECOND"
                      } else {
                          funnyRect.state = "ONE"
                      }
                  }
              }
      
              Rectangle {
                  id: funnyRect
                  x: 1256
                  y: 64
                  width: 500
                  height: 500
                  color: "grey"
                  z: 2
      
                  state: "ONE"
      
                  states: [
                      State {
                          name: "ONE"
                          PropertyChanges { target: funnyRect; scale: 1.0}
                          PropertyChanges { target: funnyRect; x: 1256}
                          PropertyChanges { target: funnyRect; y: 64}
                      },
                      State {
                          name: "SECOND"
                          PropertyChanges { target: funnyRect; scale: 0.65}
                          PropertyChanges { target: funnyRect; x: 1331}
                          PropertyChanges { target: funnyRect; y: 174}
                      }
                  ]
      
                  transitions: [
                      Transition {
                          to: "*"
                          ScaleAnimator   { duration: 1000; easing.type: Easing.InOutCubic }
                          PropertyAnimation { properties: "x,y"; duration: 1000; easing.type: Easing.InOutCubic }
                      }
                  ]
              }
      
      KillerSmathK Offline
      KillerSmathK Offline
      KillerSmath
      wrote on last edited by
      #2

      Hi @Cyna

      I guess your problem is when you try to revert the animation before the time has been over.

      Take a look at this Transition Documentation and check if it solves your problem.
      https://doc.qt.io/qt-5/qml-qtquick-transition.html#reversible-prop

      @Computer Science Student - Brazil
      Web Developer and Researcher
      “Sometimes it’s the people no one imagines anything of who do the things that no one can imagine.” - Alan Turing

      C 1 Reply Last reply
      0
      • KillerSmathK KillerSmath

        Hi @Cyna

        I guess your problem is when you try to revert the animation before the time has been over.

        Take a look at this Transition Documentation and check if it solves your problem.
        https://doc.qt.io/qt-5/qml-qtquick-transition.html#reversible-prop

        C Offline
        C Offline
        Cyna
        wrote on last edited by Cyna
        #3

        @KillerSmath Time is not a problem, in my app I don't revert animation immediately but on user request and the problem still occurrs.
        Actually I've found a solution : simply remove Transition and instead of this use Behavior on

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved