Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArt
diff options
context:
space:
mode:
Diffstat (limited to 'TurtleArt')
-rw-r--r--TurtleArt/tawindow.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/TurtleArt/tawindow.py b/TurtleArt/tawindow.py
index 1039357..c58bbae 100644
--- a/TurtleArt/tawindow.py
+++ b/TurtleArt/tawindow.py
@@ -531,6 +531,8 @@ class TurtleArtWindow():
self._autohide_shape = True
for name in OVERLAY_SHAPES:
+ if name == 'Cartesian':
+ continue
self.overlay_shapes[name] = Sprite(
self.sprite_list,
int(self.width / 2 - 600),
@@ -540,6 +542,8 @@ class TurtleArtWindow():
self.overlay_shapes[name].hide()
self.overlay_shapes[name].type = 'overlay'
+ self._create_scaled_cartesian_coordinates()
+
if self.running_turtleart and not self.running_sugar:
# offset = 2 * self.width - 55 * len(TOOLBAR_SHAPES)
offset = 55 * (1 + len(palette_blocks))
@@ -555,6 +559,26 @@ class TurtleArtWindow():
self.toolbar_shapes[name].type = 'toolbar'
self.toolbar_shapes['stopiton'].hide()
+ def _create_scaled_cartesian_coordinates(self):
+ # Cartesian overlay has to be scaled to match the coordinate_scale
+ # 200 pixels in the graphic == height / 4. (10 units)
+ pixbuf = svg_str_to_pixbuf(
+ svg_from_file('%s/images/%s.svg' % (self.path, 'Cartesian')))
+
+ if self.running_sugar:
+ scale = self.height / 800.
+ else:
+ scale = (self.height + ICON_SIZE) / 800.
+ self.overlay_shapes['Cartesian'] = Sprite(
+ self.sprite_list,
+ int(self.width / 2 - 600),
+ int(self.height / 2 - 450),
+ pixbuf.scale_simple(int(1200 * scale),
+ int(900 * scale),
+ gtk.gdk.INTERP_BILINEAR))
+ self.overlay_shapes['Cartesian'].set_layer(TAB_LAYER)
+ self.overlay_shapes['Cartesian'].hide()
+
def set_sharing(self, shared):
self._sharing = shared