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

Method _drawline

Lib/turtle.py:526–547  ·  view source on GitHub ↗

Configure lineitem according to provided arguments: coordlist is sequence of coordinates fill is drawing color width is width of drawn line. top is a boolean value, which specifies if polyitem will be put on top of the canvas' displaylist so it will no

(self, lineitem, coordlist=None,
                  fill=None, width=None, top=False)

Source from the content-addressed store, hash-verified

524 capstyle = TK.ROUND)
525
526 def _drawline(self, lineitem, coordlist=None,
527 fill=None, width=None, top=False):
528 """Configure lineitem according to provided arguments:
529 coordlist is sequence of coordinates
530 fill is drawing color
531 width is width of drawn line.
532 top is a boolean value, which specifies if polyitem
533 will be put on top of the canvas' displaylist so it
534 will not be covered by other items.
535 """
536 if coordlist is not None:
537 cl = []
538 for x, y in coordlist:
539 cl.append(x * self.xscale)
540 cl.append(-y * self.yscale)
541 self.cv.coords(lineitem, *cl)
542 if fill is not None:
543 self.cv.itemconfigure(lineitem, fill=fill)
544 if width is not None:
545 self.cv.itemconfigure(lineitem, width=width)
546 if top:
547 self.cv.tag_raise(lineitem)
548
549 def _delete(self, item):
550 """Delete graphics item from canvas.

Callers 4

_update_dataMethod · 0.80
_gotoMethod · 0.80
_undogotoMethod · 0.80
_newLineMethod · 0.80

Calls 4

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

Tested by

no test coverage detected