This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: 2 (more) bugs in turtle
Type: Stage:
Components: Library (Lib) Versions: Python 2.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: rhettinger, smichr
Priority: normal Keywords:

Created on 2003-02-13 07:00 by smichr, last changed 2022-04-10 16:06 by admin. This issue is now closed.

Messages (4)
msg14593 - (view) Author: Christopher Smith (smichr) Date: 2003-02-13 07:00
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
msg14594 - (view) Author: Christopher Smith (smichr) Date: 2003-02-26 08:21
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
msg14595 - (view) Author: Christopher Smith (smichr) Date: 2003-03-01 23:27
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
msg14596 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2003-06-09 08:51
Logged In: YES 
user_id=80475

Fixed.  See Lib/lib-tk/turtle.py 1.11.
History
Date User Action Args
2022-04-10 16:06:47adminsetgithub: 37977
2003-02-13 07:00:01smichrcreate