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

Method _newLine

Lib/turtle.py:3398–3412  ·  view source on GitHub ↗

Closes current line item and starts a new one. Remark: if current line became too long, animation performance (via _drawline) slowed down considerably.

(self, usePos=True)

Source from the content-addressed store, hash-verified

3396 self._update()
3397
3398 def _newLine(self, usePos=True):
3399 """Closes current line item and starts a new one.
3400 Remark: if current line became too long, animation
3401 performance (via _drawline) slowed down considerably.
3402 """
3403 if len(self.currentLine) > 1:
3404 self.screen._drawline(self.currentLineItem, self.currentLine,
3405 self._pencolor, self._pensize)
3406 self.currentLineItem = self.screen._createline()
3407 self.items.append(self.currentLineItem)
3408 else:
3409 self.screen._drawline(self.currentLineItem, top=True)
3410 self.currentLine = []
3411 if usePos:
3412 self.currentLine = [self._position]
3413
3414 def filling(self):
3415 """Return fillstate (True if filling, False else).

Callers 3

cloneMethod · 0.95
_gotoMethod · 0.95
begin_fillMethod · 0.95

Calls 3

_drawlineMethod · 0.80
_createlineMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected