From 75bd3ac42f68437c3c78a8e85f8359f02b8ab773 Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Thu, 23 Sep 2010 09:59:16 +0000 Subject: setxy honors pen up/pen down --- (limited to 'TurtleArt/tacanvas.py') diff --git a/TurtleArt/tacanvas.py b/TurtleArt/tacanvas.py index 9928d51..69f5352 100644 --- a/TurtleArt/tacanvas.py +++ b/TurtleArt/tacanvas.py @@ -333,6 +333,7 @@ class TurtleGraphics: def setxy(self, x, y, share=True): """ Move turtle to position x,y """ + oldx, oldy = self.xcor, self.ycor x *= self.tw.coord_scale y *= self.tw.coord_scale try: @@ -340,6 +341,11 @@ class TurtleGraphics: except TypeError, ValueError: _logger.debug("bad value sent to %s" % (__name__)) return + + if self.pendown: + self.gc.set_foreground(self.fgcolor) + self.draw_line(oldx, oldy, self.xcor, self.ycor) + self.move_turtle() if self.tw.sharing() and share: self.tw.activity.send_event("x|%s" % \ -- cgit v0.9.1