diff options
author | Gonzalo Odiard <godiard@gmail.com> | 2014-07-11 20:25:53 (GMT) |
---|---|---|
committer | Gonzalo Odiard <godiard@gmail.com> | 2014-07-14 11:00:10 (GMT) |
commit | 6f53911438cffe16fffb4e887d14fb193084e016 (patch) | |
tree | fa841d658a22de516a4e47c000da27d7c13ba186 | |
parent | 52b71294fabe2d2d167b404b990f24a72c460021 (diff) |
Animate flip when pieces match
-rw-r--r-- | game.py | 2 | ||||
-rw-r--r-- | svgcard.py | 5 |
2 files changed, 4 insertions, 3 deletions
@@ -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) @@ -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 |