Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sprites.py
diff options
context:
space:
mode:
authorWalter Bender <walter@walter-laptop.(none)>2010-02-05 14:14:05 (GMT)
committer Walter Bender <walter@walter-laptop.(none)>2010-02-05 14:14:05 (GMT)
commitea3c5d4403f9158d1938bb0219b880d80823a3ca (patch)
treef9bb69d98857bf696293b0c4da5328869064002c /sprites.py
parent35785f3b5d4ca045462fd695073006d8b910c934 (diff)
early version of highlighter code
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()