[gnome-2048] Reverse show animation manually
- From: Juan R. Garcia Blanco <juanrgar src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-2048] Reverse show animation manually
- Date: Thu, 12 Feb 2015 20:09:09 +0000 (UTC)
commit 2b38ed8698eb76811f96cf5d7026517ab35decfa
Author: Juan R. GarcĂa Blanco <juanrgar gmail com>
Date: Thu Feb 12 21:06:27 2015 +0100
Reverse show animation manually
TransitionGroup::auto-reverse property does not seem to work very well,
as tiles often fail to get back to 1.0 scale. Reversing the animation
manually seems to be much better.
src/game.vala | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/game.vala b/src/game.vala
index 933316c..bf84d94 100644
--- a/src/game.vala
+++ b/src/game.vala
@@ -572,6 +572,13 @@ public class Game : GLib.Object
private void _on_show_hide_trans_stopped (bool is_finished)
{
debug (@"show/hide animation stopped; finished $is_finished");
+
+ if (_show_hide_trans.direction == Clutter.TimelineDirection.FORWARD) {
+ _show_hide_trans.direction = Clutter.TimelineDirection.BACKWARD;
+ _show_hide_trans.start ();
+ return;
+ }
+
debug (@"$_grid");
_show_hide_trans.remove_all ();
@@ -605,8 +612,6 @@ public class Game : GLib.Object
_show_hide_trans = new Clutter.TransitionGroup ();
_show_hide_trans.stopped.connect (_on_show_hide_trans_stopped);
_show_hide_trans.set_duration (100);
- _show_hide_trans.set_auto_reverse (true);
- _show_hide_trans.set_repeat_count (1);
}
private void _finish_move ()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]