From kde-commits Tue Jan 12 11:50:00 2010 From: =?utf-8?q?Aaron=20J=2E=20Seigo?= Date: Tue, 12 Jan 2010 11:50:00 +0000 To: kde-commits Subject: KDE/kdeexamples/plasma/javascript/plasmoids/animations/contents/code Message-Id: <1263297000.743718.7016.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=126329703502776 SVN commit 1073575 by aseigo: direction is updated immediately now, so set it before starting the anim M +4 -4 main --- trunk/KDE/kdeexamples/plasma/javascript/plasmoids/animations/contents/code/main #1073574:1073575 @@ -61,7 +61,6 @@ rotateAnimation = animation('rotate') rotateAnimation.angle = 180 rotateAnimation.targetWidget = button -rotateAnimation.easingCurveType = InOutQuadEasingCurve // Now we will add them to a group to run in parallel with each other // this coordinates the animations for us and we will just use the animation @@ -69,15 +68,16 @@ rotateAndFadeAnimationGroup = new ParallelAnimationGroup rotateAndFadeAnimationGroup.addAnimation(fadeAnimation) rotateAndFadeAnimationGroup.addAnimation(rotateAnimation) +rotateAndFadeAnimationGroup.direction = AnimationBackward; // this function will be triggered by the 'Rotate and Fade' button being clicked startRotateAndFadeAnimation = function() { + // now reverse the direction for the next click! + rotateAndFadeAnimationGroup.direction = rotateAndFadeAnimationGroup.direction == AnimationForward ? AnimationBackward : AnimationForward; + // start the animation rotateAndFadeAnimationGroup.start() - - // now reverse the direction for the next click! - rotateAndFadeAnimationGroup.direction = rotateAndFadeAnimationGroup.direction == AnimationForward ? AnimationBackward : AnimationForward; } // connect the clicked signal to our function above button.clicked.connect(startRotateAndFadeAnimation);