Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tacanvas.py
diff options
context:
space:
mode:
authorWalter Bender <walter@sugarlabs.org>2010-03-03 22:48:06 (GMT)
committer Walter Bender <walter@sugarlabs.org>2010-03-03 22:48:06 (GMT)
commit088a1576c5a29248e409c24b7ca1ff13cc28e16d (patch)
treef3c224bdee142dfe7320bb6a9f3badcfb38a1ca2 /tacanvas.py
parent172cadb172f87666985a3cbba71d658d27a1d79b (diff)
tightened up get path code
Diffstat (limited to 'tacanvas.py')
-rw-r--r--tacanvas.py9
1 files changed, 8 insertions, 1 deletions
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