# HG changeset patch # User sl # Date 1401862357 -7200 # Node ID 1c2a7f56301926c41f357d5e1f675058bb05b273 # Parent e68f1542d9d356b49950ab6b6e7639c173e4e3ec Messing around to try to get our animation to start and stop properly. That's still not working though. diff -r e68f1542d9d3 -r 1c2a7f563019 MarqueeText.qml --- a/MarqueeText.qml Tue Jun 03 18:35:43 2014 +0200 +++ b/MarqueeText.qml Wed Jun 04 08:12:37 2014 +0200 @@ -35,28 +35,31 @@ //Reset to zero and restart onStopped so that we keep looping //onStopped: {scrollingText.x=0;running=true;} + property int lengthInPixels:scrollingText.width-separatorText.width-scrollingText.x; + property int durationInMs:(animation.lengthInPixels)*1000/pixelsPerSeconds; + NumberAnimation { target: scrollingText; properties: "x" from: scrollingText.x; - to: scrollingText.x-scrollingText.width-separatorText.width; - duration: (scrollingText.width+separatorText.width)*1000/pixelsPerSeconds + to: scrollingText.x-animation.lengthInPixels; + duration:animation.durationInMs } NumberAnimation { target: separatorText; properties: "x" from: separatorText.x; - to: separatorText.x-scrollingText.width-separatorText.width; - duration: (scrollingText.width+separatorText.width)*1000/pixelsPerSeconds + to: separatorText.x-animation.lengthInPixels; + duration: animation.durationInMs } NumberAnimation { target: followingText; properties: "x" from: followingText.x; - to: followingText.x-scrollingText.width-separatorText.width; - duration: (scrollingText.width+separatorText.width)*1000/pixelsPerSeconds + to: followingText.x-animation.lengthInPixels; + duration: animation.durationInMs } } @@ -65,8 +68,22 @@ MouseArea { id:mouseArea anchors.fill: parent - onClicked: { - animation.running=!animation.running; + onClicked: {animation.running=!animation.running; + /* + if (!animation.running) { + animation.start(); + return; + } + if (animation.paused) + { + console.log("resume") + animation.resume; + } + else + { + console.log("pause") + animation.pause; + }*/ } } } diff -r e68f1542d9d3 -r 1c2a7f563019 MiniDisplay/minidisplay.cpp --- a/MiniDisplay/minidisplay.cpp Tue Jun 03 18:35:43 2014 +0200 +++ b/MiniDisplay/minidisplay.cpp Wed Jun 04 08:12:37 2014 +0200 @@ -219,7 +219,7 @@ void MiniDisplay::onAfterAnimating() { static int frame=0; - qDebug() << frame << "MiniDisplay::onAfterAnimating"; + //qDebug() << frame << "MiniDisplay::onAfterAnimating"; /* if (iAfterAnimatingCallback.isCallable()) { diff -r e68f1542d9d3 -r 1c2a7f563019 TestsTab.qml --- a/TestsTab.qml Tue Jun 03 18:35:43 2014 +0200 +++ b/TestsTab.qml Wed Jun 04 08:12:37 2014 +0200 @@ -133,7 +133,7 @@ } - var frameCounter=frameCount-firstFrame; + var frameCounter=(frameCount-firstFrame)/2; labelFrameCount.text=frameCounter; labelTime.text=milliseconds/1000; labelTimePerFrame.text=(milliseconds/frameCounter).toFixed(3);