MCPcopy Index your code
hub / github.com/python/cpython / _drawpoly

Method _drawpoly

Lib/turtle.py:495–518  ·  view source on GitHub ↗

Configure polygonitem polyitem according to provided arguments: coordlist is sequence of coordinates fill is filling color outline is outline color top is a boolean value, which specifies if polyitem will be put on top of the canvas' displaylist so it

(self, polyitem, coordlist, fill=None,
                  outline=None, width=None, top=False)

Source from the content-addressed store, hash-verified

493 return self.cv.create_polygon((0, 0, 0, 0, 0, 0), fill="", outline="")
494
495 def _drawpoly(self, polyitem, coordlist, fill=None,
496 outline=None, width=None, top=False):
497 """Configure polygonitem polyitem according to provided
498 arguments:
499 coordlist is sequence of coordinates
500 fill is filling color
501 outline is outline color
502 top is a boolean value, which specifies if polyitem
503 will be put on top of the canvas' displaylist so it
504 will not be covered by other items.
505 """
506 cl = []
507 for x, y in coordlist:
508 cl.append(x * self.xscale)
509 cl.append(-y * self.yscale)
510 self.cv.coords(polyitem, *cl)
511 if fill is not None:
512 self.cv.itemconfigure(polyitem, fill=fill)
513 if outline is not None:
514 self.cv.itemconfigure(polyitem, outline=outline)
515 if width is not None:
516 self.cv.itemconfigure(polyitem, width=width)
517 if top:
518 self.cv.tag_raise(polyitem)
519
520 def _createline(self):
521 """Create an invisible line item on canvas self.cv)

Callers 4

_drawturtleMethod · 0.80
stampMethod · 0.80
end_fillMethod · 0.80
_undoMethod · 0.80

Calls 4

appendMethod · 0.45
coordsMethod · 0.45
itemconfigureMethod · 0.45
tag_raiseMethod · 0.45

Tested by

no test coverage detected