From e6f1790e6ac8a249330e534b1c62957d23908279 Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Sat, 13 Feb 2010 01:21:31 +0000 Subject: skins scale properly --- (limited to 'sprites.py') diff --git a/sprites.py b/sprites.py index 752bb20..a361ba0 100644 --- a/sprites.py +++ b/sprites.py @@ -169,15 +169,10 @@ class Sprite: _h = self.images[i].get_height() else: _w, _h = self.images[i].get_size() - if len(self.images) == 1: - self._width = _w + self._dx[0] - self._height = _h + self._dy[0] + if i == 0: # Always reset width and height when base image changes. + self._width = _w + dx + self._height = _h + dy else: - if isinstance(self.images[i], gtk.gdk.Pixbuf): - _w = self.images[i].get_width() - _h = self.images[i].get_height() - else: - _w, _h = self.images[i].get_size() if _w + dx > self._width: self._width = _w + dx if _h + dy > self._height: -- cgit v0.9.1