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

Method _getshapepoly

tools/python-3.11.9-amd64/Lib/turtle.py:2998–3009  ·  view source on GitHub ↗

Calculate transformed shape polygon according to resizemode and shapetransform.

(self, polygon, compound=False)

Source from the content-addressed store, hash-verified

2996 # else return None
2997
2998 def _getshapepoly(self, polygon, compound=False):
2999 """Calculate transformed shape polygon according to resizemode
3000 and shapetransform.
3001 """
3002 if self._resizemode == "user" or compound:
3003 t11, t12, t21, t22 = self._shapetrafo
3004 elif self._resizemode == "auto":
3005 l = max(1, self._pensize/5.0)
3006 t11, t12, t21, t22 = l, 0, 0, l
3007 elif self._resizemode == "noresize":
3008 return polygon
3009 return tuple((t11*x + t12*y, t21*x + t22*y) for (x, y) in polygon)
3010
3011 def _drawturtle(self):
3012 """Manages the correct rendering of the turtle with respect to

Callers 3

get_shapepolyMethod · 0.95
_drawturtleMethod · 0.95
stampMethod · 0.95

Calls 2

maxFunction · 0.85
tupleClass · 0.85

Tested by

no test coverage detected