Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArt/tacanvas.py
diff options
context:
space:
mode:
authorWalter Bender <walter.bender@gmail.com>2011-10-31 22:29:21 (GMT)
committer Walter Bender <walter.bender@gmail.com>2011-10-31 22:29:21 (GMT)
commita11dac6b1af290ed224119fd9fe4565a69e26f68 (patch)
tree081715f516b5a16d8958cac088cb1246901e4d68 /TurtleArt/tacanvas.py
parent905295c256eeef02a40a084a700831370a501a8c (diff)
more cleaning up cairo code
Diffstat (limited to 'TurtleArt/tacanvas.py')
-rw-r--r--TurtleArt/tacanvas.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/TurtleArt/tacanvas.py b/TurtleArt/tacanvas.py
index 52e337b..1a37fc9 100644
--- a/TurtleArt/tacanvas.py
+++ b/TurtleArt/tacanvas.py
@@ -544,9 +544,14 @@ class TurtleGraphics:
# Build a gtk.gdk.CairoContext from a cairo.Context to access
# the set_source_pixbuf attribute.
cr = gtk.gdk.CairoContext(self.canvas)
+ cr.save()
+ cr.rotate(self.heading * DEGTOR)
cr.set_source_pixbuf(pixbuf, x, y)
+ # To do: reposition rectangle based on angle of rotation
cr.rectangle(x, y, w, h)
+ cr.rotate(-self.heading * DEGTOR)
cr.fill()
+ cr.restore()
self.inval()
if self.tw.saving_svg:
if self.tw.running_sugar:
@@ -593,6 +598,7 @@ class TurtleGraphics:
pl.set_width(int(w) * pango.SCALE)
cr.save()
cr.translate(x, y)
+ cr.rotate(self.heading * DEGTOR)
self.canvas.set_source_rgb(self.fgrgb[0] / 255.,
self.fgrgb[1] / 255.,
self.fgrgb[2] / 255.)