Re: Upgrading deprecations
- From: phantomjinx <p g richardson phantomjinx co uk>
- To: clutter-list gnome org
- Subject: Re: Upgrading deprecations
- Date: Fri, 24 May 2013 22:16:13 +0100
On 05/13/2013 12:12 PM, Lionel Landwerlin wrote:
On 13/05/13 10:36, phantomjinx wrote:
Hi,
I am trying to bring the coverflow CD animation in gtkpod up to version 1.12 by removing the
deprecations.
Having replaced ClutterBehaviour and ClutterAnimation with use of the easing state as described here
[1], I have
run into a problem.
Clicking the right button scrolls the set of CD covers to the left and likewise clicking the left
button scrolls to the right.
With an easing duration of 1600ms, this works nicely except that the rotation is always clockwise
whereas with ClutterBehaviour I was
able to set it to counter-clockwise ensuring that a CD cover would rotate the shortest way around,
rather than spinning needlessly.
You will have to implement this behavior yourself :(
Secondly and more importantly, if I click the right button quickly, the animation may still be in
the middle hence the covers end up out of
position to the point that some even end up on the wrong side of the screen. I originally got around
this by calling clutter_timeline_stop
and clearing all clutter behaviours before starting a new animation. How would I achieve the same
kind of thing with the easing state please?
When doing an implicit animation on an actor, you can get a ClutterTransition object (subclass of
ClutterTimeline) by calling clutter_actor_get_transition() (might return NULL if no implicit
animations are running). You can use the returned object to stop the implicit animation and trigger
a new implicit animation.
<snip>
[1] https://developer.gnome.org/clutter/stable/migrating-ClutterAnimation.html
[2]
https://gitorious.org/~phantomjinx/gtkpod/phantomjinx-gtkpod-plugin/blobs/updating-clarity/plugins/clarity/clarity_canvas.c
Hi,
So, with the help of Lionel (thx!), I have successfully solved the second problem. By removing all
transitions before kicking off
a new transition ensures I can click buttons as fast as I like with no ill-effects. Thanks for the info.
However, the first problem (outlined above) is still an issue but I am starting to understand it a
little better. When a cover is moved
from the right of the screen to the centre, it changes from a rotation angle of 290 to an angle of
0. Likewise, a cover moving from the
centre to the left of the screen rotates from an angle of 0 to 70 (all on the Y-axis).
The problem seems to be excessive rotation when the angle is large. In this case going from 290 -> 0
seems to add an extra 360 degree rotation,
giving the animation of the cover a complete full spin before landing in position. For the 0 -> 70,
this spin does not take place and the cover
simply slides into place. Can somebody explain what would be causing this and how I would go about
implementing something to stop it?
Many thanks
PGR
--
Paul Richardson
* p g richardson phantomjinx co uk
* p g richardson redhat com
* pgrichardson linux com
"I know exactly who reads the papers ...
* The Daily Mirror is read by people who think they run the country.
* The Guardian is read by people who think they ought to run the country.
* The Times is read by people who do actually run the country.
* The Daily Mail is read by the wives of the people who run the country.
* The Financial Times is read by the people who own the country.
* The Morning Star is read by the people who think the country ought to be run by another country.
* The Daily Telegraph is read by the people who think it is."
Jim Hacker, Yes Minister
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]