Review Request: Added bouncing effect for Rotation animation

Aaron Seigo aseigo at kde.org
Wed Apr 7 19:13:35 CEST 2010



> On 2010-04-07 15:37:53, Marco Martin wrote:
> > thinking about it, if we want animations to go back and forth, what about having it in Animation? it could make sense for most of those
> > there would be a boolean bouncing (better name required)
> > an "attenuation" value and the "bouncecenter" property, that would define the "cener" towands the attenuation goes, we could want it stopping at 0.5 in the end

isn't that the entire point of easing curves (as you noted in your first comment?). Animation already has support for setting easing curves, the animations just need to use them. perhaps Plasma::Animation should have been a QVariantAnimation instead of a QAbstractAnimation? too late now, in any case. what's also a bit too late is putting code into Animation::updateCurrentTime to do easing curves directly, as QVariantAnimation does (it provides another pure virtual for its subclasses to implement). we could go the nasty route of a slot that our animations override and which Plasma::Animation invoke()s in updateCurrentTime. we'd want to mark that with a "turn into a pure virtual in kde5" note, though.

*thinks*

actually, better idea: introduce a new internal class that does pretty much exactly what QVariantAnimation does and move all the internal animations to it. that would be very simple, as it would be just changing the class name they inherit from and changing "updateCurrentTime" to "updateCurrentValue" or whatever. when we break BC next,we can fold this into the main class. i'll post a patch to plasma-devel showing what i mean in a moment...


- Aaron


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/3513/#review4912
-----------------------------------------------------------


On 2010-04-07 14:56:43, Bruno Abinader wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/3513/
> -----------------------------------------------------------
> 
> (Updated 2010-04-07 14:56:43)
> 
> 
> Review request for Plasma, igorto and Adenilson Cavalcanti.
> 
> 
> Summary
> -------
> 
> A new property "isBounceable" is added to the Rotation animation, which causes the target widget to "bounce" on a range between (-angle()/2, angle()/2). A static number of steps is defined by default (10 steps), causing the bounce angle to decrease through the animation steps. Notice that this effect doesn't behaves properly when the animation is part of a group, falling back to the "non-bounceable" behavior when it is part of a group.
> 
> 
> Diffs
> -----
> 
>   trunk/KDE/kdelibs/plasma/animations/rotation_p.h 1111462 
>   trunk/KDE/kdelibs/plasma/animations/rotation.cpp 1111462 
> 
> Diff: http://reviewboard.kde.org/r/3513/diff
> 
> 
> Testing
> -------
> 
> Tests have been made for different angles/axis on an additional example button on the animation plasmoid example. This example code is not yet release, but I can kindly pastebin it if needed.
> 
> 
> Thanks,
> 
> Bruno
> 
>



More information about the Plasma-devel mailing list