Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <mpg@redhat.com>2007-08-26 13:01:16 (GMT)
committer Marco Pesenti Gritti <mpg@redhat.com>2007-08-26 13:01:16 (GMT)
commitf1fc80b4a83135473d9546390d58a6ea50b1fd53 (patch)
tree4fb961e5a6c4b7f3858eee98f2b94cb7aa19ed3d /sugar
parentba4f68ef58272fb57f6005b73d4d59dc7911470d (diff)
Fix icon padding.
Diffstat (limited to 'sugar')
-rw-r--r--sugar/graphics/icon.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/sugar/graphics/icon.py b/sugar/graphics/icon.py
index ad57da3..bd050ae 100644
--- a/sugar/graphics/icon.py
+++ b/sugar/graphics/icon.py
@@ -215,15 +215,15 @@ class _IconBuffer(object):
return info
info.size = int(_BADGE_SIZE * icon_width)
- info.attach_x = icon_info.attach_x * icon_width - info.size / 2
- info.attach_y = icon_info.attach_y * icon_height - info.size / 2
+ info.attach_x = int(icon_info.attach_x * icon_width - info.size / 2)
+ info.attach_y = int(icon_info.attach_y * icon_height - info.size / 2)
if info.attach_x < 0 or info.attach_y < 0:
info.icon_padding = max(-info.attach_x, -info.attach_y)
elif info.attach_x + info.size > icon_width or \
info.attach_y + info.size > icon_height:
- x_padding = icon_width - info.attach_x - info.size
- y_padding = icon_height - info.attach_y - info.size
+ x_padding = info.attach_x + info.size - icon_width
+ y_padding = info.attach_y + info.size - icon_height
info.icon_padding = max(x_padding, y_padding)
return info