diff options
author | Pootle daemon <pootle@pootle.sugarlabs.org> | 2013-02-07 05:31:30 (GMT) |
---|---|---|
committer | Pootle daemon <pootle@pootle.sugarlabs.org> | 2013-02-07 05:31:30 (GMT) |
commit | 35db5b79b051fe837d2661ca7e509da6e55080ea (patch) | |
tree | 2e7155415d2e70c075cf50ab71027adea66e2098 /TurtleArt | |
parent | fa32af630fa8bdb18ba9012c9e27fc1950ce0918 (diff) | |
parent | 9805f71161b8dbdc0706e28195197596959e09ed (diff) |
Merge branch 'master' of git.sugarlabs.org:turtleart/mainline
Diffstat (limited to 'TurtleArt')
-rw-r--r-- | TurtleArt/sprites.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/TurtleArt/sprites.py b/TurtleArt/sprites.py index 844e171..de5a0b5 100644 --- a/TurtleArt/sprites.py +++ b/TurtleArt/sprites.py @@ -402,14 +402,10 @@ class Sprite: pl.set_font_description(self._fd) w = pl.get_size()[0] / pango.SCALE else: - j = len(self.labels[i]) - 1 - while(w > my_width and j > 0): - pl.set_text( - "…" + self.labels[i][len(self.labels[i]) - j:]) - self._fd.set_size(int(self._scale[i] * pango.SCALE)) - pl.set_font_description(self._fd) - w = pl.get_size()[0] / pango.SCALE - j -= 1 + pl.set_width(int(my_width * pango.SCALE)) + pl.set_ellipsize(pango.ELLIPSIZE_MIDDLE) + pl.set_text(str(self.labels[i])) + w = pl.get_size()[0] / pango.SCALE if self._x_pos[i] is not None: x = int(self.rect.x + self._x_pos[i]) elif self._horiz_align[i] == "center": |