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

Method _newLine

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

3295 self._update()
3296
3297 def _newLine(self, usePos=True):
3298 """Closes current line item and starts a new one.
3299 Remark: if current line became too long, animation
3300 performance (via _drawline) slowed down considerably.
3301 """
3302 if len(self.currentLine) > 1:
3303 self.screen._drawline(self.currentLineItem, self.currentLine,
3304 self._pencolor, self._pensize)
3305 self.currentLineItem = self.screen._createline()
3306 self.items.append(self.currentLineItem)
3307 else:
3308 self.screen._drawline(self.currentLineItem, top=True)
3309 self.currentLine = []
3310 if usePos:
3311 self.currentLine = [self._position]
3312
3313 def filling(self):
3314 """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