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

Method _drawline

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

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

Source from the content-addressed store, hash-verified

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