MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _drawpoly

Method _drawpoly

tools/python-3.11.9-amd64/Lib/turtle.py:499–522  ·  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

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

Source from the content-addressed store, hash-verified

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