Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sprites.py
diff options
context:
space:
mode:
Diffstat (limited to 'sprites.py')
-rw-r--r--sprites.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/sprites.py b/sprites.py
index 14394e2..43adb36 100644
--- a/sprites.py
+++ b/sprites.py
@@ -151,7 +151,7 @@ class Sprite:
self.layer = 100
self.labels = []
self.images = []
- self._dx = []
+ self._dx = [] # image offsets
self._dy = []
self.set_image(image)
self._sprites.append_to_list(self)
@@ -172,11 +172,17 @@ class Sprite:
if len(self.images) == 1:
self._width = _w
self._height = _h
- else: # TODO: fix this calculation
- if _w > self._width:
- self._width = _w
- if _h > self._height:
- self._height = _h
+ 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
def move(self, pos):
self.inval()