[Python-bugs-list] [ python-Bugs-685773 ] 2 (more) bugs in turtle

SourceForge.net noreply@sourceforge.net
Wed, 26 Feb 2003 00:21:20 -0800


Bugs item #685773, was opened at 2003-02-13 01:00
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: Open
Resolution: None
Priority: 5
Submitted By: Christopher Smith (smichr)
Assigned to: Nobody/Anonymous (nobody)
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: Christopher Smith (smichr)
Date: 2003-02-26 02: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