Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar
diff options
context:
space:
mode:
Diffstat (limited to 'sugar')
-rw-r--r--sugar/graphics/canvasicon.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/sugar/graphics/canvasicon.py b/sugar/graphics/canvasicon.py
index 01e4c0b..2d983ae 100644
--- a/sugar/graphics/canvasicon.py
+++ b/sugar/graphics/canvasicon.py
@@ -143,7 +143,11 @@ class CanvasIcon(hippo.CanvasBox, hippo.CanvasItem):
icon_name, self._color, self._size)
buf = self._get_buffer(cr, handle, self._size)
- cr.set_source_surface(buf, 0.0, 0.0)
+ [width, height] = self.get_allocation()
+ x = (width - self._size) / 2
+ y = (height - self._size) / 2
+
+ cr.set_source_surface(buf, x, y)
cr.paint()
def do_get_width_request(self):