Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2014-07-11 20:25:53 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2014-07-14 11:00:10 (GMT)
commit6f53911438cffe16fffb4e887d14fb193084e016 (patch)
treefa841d658a22de516a4e47c000da27d7c13ba186
parent52b71294fabe2d2d167b404b990f24a72c460021 (diff)
Animate flip when pieces match
-rw-r--r--game.py2
-rw-r--r--svgcard.py5
2 files changed, 4 insertions, 3 deletions
diff --git a/game.py b/game.py
index d615390..e188df6 100644
--- a/game.py
+++ b/game.py
@@ -242,8 +242,6 @@ class MemorizeGame(GObject.GObject):
pair_key_2 = self.model.grid[identifier]['pairkey']
if pair_key_1 == pair_key_2:
- flip_card(full_animation=False)
-
stroke_color, fill_color = \
self.current_player.props.color.split(',')
self.emit('set-border', identifier, stroke_color, fill_color)
diff --git a/svgcard.py b/svgcard.py
index 4ab45eb..4f80197 100644
--- a/svgcard.py
+++ b/svgcard.py
@@ -187,7 +187,10 @@ class SvgCard(Gtk.EventBox):
self.props['front'].update({'fill_color': style.Color(fill_color),
'stroke_color': style.Color(stroke_color)})
self._cached_surface[True] = None
- self.queue_draw()
+ if not self.is_flipped():
+ self.flip(full_animation=True)
+ else:
+ self.queue_draw()
def set_pixbuf(self, pixbuf):
self.jpeg = pixbuf