From 75b09fa3329de3e2b9a856ba0263ce74d6b28f3f Mon Sep 17 00:00:00 2001 From: Marion Date: Tue, 27 Aug 2013 12:51:05 +0000 Subject: change interface of Turtle.set_xy to set_xy(x, y, share, pendown) - Used to be set_xy(pos, share, pendown) with pos = (x, y). - Some calls to set_xy were already assuming the new interface. - Also fix the 'bullet list' block from the 'presentations' palette. (Small, related bug.) --- (limited to 'TurtleArt/taturtle.py') diff --git a/TurtleArt/taturtle.py b/TurtleArt/taturtle.py index 12882db..10d0230 100644 --- a/TurtleArt/taturtle.py +++ b/TurtleArt/taturtle.py @@ -154,7 +154,7 @@ class Turtles: # if it is a new turtle, start it in the center of the screen self._active_turtle = self.get_turtle(turtle_name, True, colors) self._active_turtle.set_heading(0.0, False) - self._active_turtle.set_xy((0.0, 0.0), False, pendown=False) + self._active_turtle.set_xy(0.0, 0.0, False, pendown=False) self._active_turtle.set_pen_state(True) elif colors is not None: self._active_turtle = self.get_turtle(turtle_name, False) @@ -555,12 +555,12 @@ class Turtle: int(distance)])) self._turtles.turtle_window.send_event(event) - def set_xy(self, pos, share=True, pendown=True): + def set_xy(self, x, y, share=True, pendown=True): old = self.get_xy() try: - xcor = pos[0] * self._turtles.turtle_window.coord_scale - ycor = pos[1] * self._turtles.turtle_window.coord_scale + xcor = x * self._turtles.turtle_window.coord_scale + ycor = y * self._turtles.turtle_window.coord_scale except (TypeError, ValueError): debug_output('bad value sent to %s' % (__name__), self._turtles.turtle_window.running_sugar) -- cgit v0.9.1