Strange rescaling at the end of scale animation (Linux only)
-
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.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 } } ] }
-
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 -
@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 removeTransition
and instead of this useBehavior on