Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArt/talogo.py
diff options
context:
space:
mode:
authorWalter Bender <walter@sugarlabs.org>2010-09-22 21:38:10 (GMT)
committer Walter Bender <walter@sugarlabs.org>2010-09-22 21:38:10 (GMT)
commitcae91fb79822066f07ca5b54034cce8b53654d1a (patch)
tree3db8714b2995364d79e77f5538ac8caa4afdd173 /TurtleArt/talogo.py
parent8e4c9bddbf801582a15eb57c122b5e74341bc89c (diff)
refactoring turtle skin scaling (#2353)
Diffstat (limited to 'TurtleArt/talogo.py')
-rw-r--r--TurtleArt/talogo.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/TurtleArt/talogo.py b/TurtleArt/talogo.py
index 0af7110..b44116e 100644
--- a/TurtleArt/talogo.py
+++ b/TurtleArt/talogo.py
@@ -33,7 +33,8 @@ try:
except:
pass
-from taconstants import PALETTES, PALETTE_NAMES, TAB_LAYER, BLACK, WHITE
+from taconstants import PALETTES, PALETTE_NAMES, TAB_LAYER, BLACK, WHITE, \
+ DEFAULT_SCALE, ICON_SIZE
from tagplay import play_audio, play_movie_from_file, stop_media
from tajail import myfunc, myfunc_import
from tautils import get_pixbuf_from_journal, movie_media_type, convert, \
@@ -245,8 +246,6 @@ def millis():
return int(clock()*1000)
-_DEFAULT_SCALE = 33
-
"""
A class for parsing Logo Code
"""
@@ -423,7 +422,7 @@ class LogoCode:
self.body_height = int((self.tw.canvas.height/40)*self.tw.scale)
self.bullet_height = int((self.tw.canvas.height/30)*self.tw.scale)
- self.scale = _DEFAULT_SCALE
+ self.scale = DEFAULT_SCALE
def defprim(self, name, args, fcn, rprim=False):
""" Define the primitives associated with the blocks """
@@ -1074,9 +1073,8 @@ class LogoCode:
def reskin(self, media):
""" Reskin the turtle with an image from a file """
- w = int(self.scale)
- h = int(self.scale)
- pixbuf = self.show_picture(media, 0, 0, w, h, False)
+ scale = int(ICON_SIZE * float(self.scale) / DEFAULT_SCALE)
+ pixbuf = self.show_picture(media, 0, 0, scale, scale, False)
if pixbuf is not None:
self.tw.active_turtle.set_shapes([pixbuf])