diff options
author | Walter Bender <walter.bender@gmail.com> | 2011-11-20 22:25:02 (GMT) |
---|---|---|
committer | Walter Bender <walter.bender@gmail.com> | 2011-11-20 22:25:02 (GMT) |
commit | 4d28b2aff5fb4699d60c9d193b3b16db71d03b07 (patch) | |
tree | 8f8401c05f098d9418254dbe5775bdbbf3cc151f /TurtleArt | |
parent | 48f35a4855f4038106f0782ecb2338a9973bae68 (diff) |
scale pixbufs in insert_image
Diffstat (limited to 'TurtleArt')
-rw-r--r-- | TurtleArt/talogo.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/TurtleArt/talogo.py b/TurtleArt/talogo.py index d837f3c..8f2b599 100644 --- a/TurtleArt/talogo.py +++ b/TurtleArt/talogo.py @@ -572,7 +572,11 @@ class LogoCode: w, h = self.wpercent(), self.hpercent() if w < 1 or h < 1: return - if not pixbuf and self.dsobject is not None: + if pixbuf: # We may have to rescale the picture + if w != self.pixbuf.get_width() or h != self.pixbuf.get_height(): + self.pixbuf = self.pixbuf.scale_simple( + w, h, gtk.gdk.INTERP_BILINEAR) + elif self.dsobject is not None: try: self.pixbuf = get_pixbuf_from_journal(self.dsobject, w, h) except: |