diff options
author | Walter Bender <walter@walter-laptop.(none)> | 2010-02-12 20:55:29 (GMT) |
---|---|---|
committer | Walter Bender <walter@walter-laptop.(none)> | 2010-02-12 20:55:29 (GMT) |
commit | 6f521ee95ff53f8b488f2349e4d096fa1903e23c (patch) | |
tree | a8281589b97a6a81879af39ce8401e02dbdc78e6 | |
parent | 64207cfdff1d850772e5145805cb6df774ac263a (diff) |
taking into account dx,dy in calculating sprite size
-rw-r--r-- | sprites.py | 23 |
1 files changed, 11 insertions, 12 deletions
@@ -170,19 +170,18 @@ class Sprite: else: _w, _h = self.images[i].get_size() if len(self.images) == 1: - self._width = _w - self._height = _h + self._width = _w + self._dx[0] + self._height = _h + self._dy[0] else: - for img in self.images: - 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 > self._width: - self._width = _w - if _h > self._height: - self._height = _h + 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: + self._height = _h + dy def move(self, pos): self.inval() |