From 088a1576c5a29248e409c24b7ca1ff13cc28e16d Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Wed, 03 Mar 2010 22:48:06 +0000 Subject: tightened up get path code --- (limited to 'tacanvas.py') diff --git a/tacanvas.py b/tacanvas.py index 054f309..5516327 100644 --- a/tacanvas.py +++ b/tacanvas.py @@ -23,6 +23,7 @@ import gtk from math import sin, cos, pi from sprites import Sprite from tasprite_factory import SVG +from tautils import image_to_base64 import pango from taconstants import CANVAS_LAYER, DEFAULT_TURTLE @@ -306,7 +307,13 @@ class TurtleGraphics: self.canvas.images[0].draw_pixbuf(self.gc, pixbuf, a, b, x, y) self.invalt(x, y, w, h) if self.tw.saving_svg: - self.tw.svg_string += self.svg.image(x-self.width/2, y, w, h, path) + if self.tw.running_sugar: + # In Sugar, we need to embed the images inside the SVG + self.tw.svg_string += self.svg.image(x-self.width/2, y, w, h, + path, image_to_base64(pixbuf, self.tw.activity)) + else: + self.tw.svg_string += self.svg.image(x-self.width/2, y, w, h, + path) def draw_text(self, label, x, y, size, w): w *= self.tw.coord_scale -- cgit v0.9.1