MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / _drawline

Method _drawline

Python/Turtle.py:427–448  ·  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

425 capstyle = TK.ROUND)
426
427 def _drawline(self, lineitem, coordlist=None,
428 fill=None, width=None, top=False):
429 """Configure lineitem according to provided arguments:
430 coordlist is sequence of coordinates
431 fill is drawing color
432 width is width of drawn line.
433 top is a boolean value, which specifies if polyitem
434 will be put on top of the canvas' displaylist so it
435 will not be covered by other items.
436 """
437 if coordlist is not None:
438 cl = []
439 for x, y in coordlist:
440 cl.append(x * self.xscale)
441 cl.append(-y * self.yscale)
442 self.cv.coords(lineitem, *cl)
443 if fill is not None:
444 self.cv.itemconfigure(lineitem, fill=fill)
445 if width is not None:
446 self.cv.itemconfigure(lineitem, width=width)
447 if top:
448 self.cv.tag_raise(lineitem)
449
450 def _delete(self, item):
451 """Delete graphics item from canvas.

Callers 4

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

Calls

no outgoing calls

Tested by

no test coverage detected