[Python-bugs-list] [ python-Bugs-685773 ] 2 (more) bugs in turtle
SourceForge.net
noreply@sourceforge.net
Mon, 09 Jun 2003 01:51:51 -0700
Bugs item #685773, was opened at 2003-02-13 02:00
Message generated for change (Comment added) made by rhettinger
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=685773&group_id=5470
Category: Python Library
Group: Python 2.3
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Christopher Smith (smichr)
Assigned to: Raymond Hettinger (rhettinger)
Summary: 2 (more) bugs in turtle
Initial Comment:
1) After initiating filling with the fill(1) command, the next fill
command (e.g. fill(0)) does not cause the filling to take place.
FIlling does not occur until the next draw statement occurs.
SOLUTION:
###
At the end of the IF block in fill(), put the following lines as
delimited below with the #-- comment:
def fill(self, flag):
if self._filling:
<cut>
self._items.append(item)
#--cps Addition to force filling. Filling doesn't occur until
#--a move command is issued, so a "move" to the
#--present position is being issued to force the
#--filling to occur.
x,y=self._position
self._goto(x,y)
#--
self._path = []
###
2) The last line of the goto() (not the _goto()) function incorrectly
computes the x coordinate as x-x0. You can verify this by issuing
a goto(0,0) command as the first turtle command: the turtle
wanders off of the origin.
SOLUTION The coordinate should be computed as x0+x as shown
below (again, this is the last line of the goto() function):
self._goto(x0+x, y0-y)
/c
----------------------------------------------------------------------
>Comment By: Raymond Hettinger (rhettinger)
Date: 2003-06-09 03:51
Message:
Logged In: YES
user_id=80475
Fixed. See Lib/lib-tk/turtle.py 1.11.
----------------------------------------------------------------------
Comment By: Christopher Smith (smichr)
Date: 2003-03-01 18:27
Message:
Logged In: YES
user_id=514525
Regarding #2, I don't know what I was looking at! :-( I am looking again
at the code and it is x0+x, y0-y as it should be. Disregard #2.
/c
----------------------------------------------------------------------
Comment By: Christopher Smith (smichr)
Date: 2003-02-26 03:21
Message:
Logged In: YES
user_id=514525
Regarding #1, a better patch has been to name the fill() function as _fill()
and create a new fill() function as follows:
def fill(self,n):
self._fill(n)
self.forward(0) #a null move
The previous patch from #1 (as I learned) did not fill circles properly.
/c
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=685773&group_id=5470