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

Method _newLine

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

3177 self._update()
3178
3179 def _newLine(self, usePos=True):
3180 """Closes current line item and starts a new one.
3181 Remark: if current line became too long, animation
3182 performance (via _drawline) slowed down considerably.
3183 """
3184 if len(self.currentLine) > 1:
3185 self.screen._drawline(self.currentLineItem, self.currentLine,
3186 self._pencolor, self._pensize)
3187 self.currentLineItem = self.screen._createline()
3188 self.items.append(self.currentLineItem)
3189 else:
3190 self.screen._drawline(self.currentLineItem, top=True)
3191 self.currentLine = []
3192 if usePos:
3193 self.currentLine = [self._position]
3194
3195 def filling(self):
3196 """Return fillstate (True if filling, False else).

Callers 3

cloneMethod · 0.95
_gotoMethod · 0.95
begin_fillMethod · 0.95

Calls 2

_drawlineMethod · 0.80
_createlineMethod · 0.80

Tested by

no test coverage detected