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

Method _getshapepoly

Lib/turtle.py:3099–3110  ·  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

3097 # else return None
3098
3099 def _getshapepoly(self, polygon, compound=False):
3100 """Calculate transformed shape polygon according to resizemode
3101 and shapetransform.
3102 """
3103 if self._resizemode == "user" or compound:
3104 t11, t12, t21, t22 = self._shapetrafo
3105 elif self._resizemode == "auto":
3106 l = max(1, self._pensize/5.0)
3107 t11, t12, t21, t22 = l, 0, 0, l
3108 elif self._resizemode == "noresize":
3109 return polygon
3110 return tuple((t11*x + t12*y, t21*x + t22*y) for (x, y) in polygon)
3111
3112 def _drawturtle(self):
3113 """Manages the correct rendering of the turtle with respect to

Callers 3

get_shapepolyMethod · 0.95
_drawturtleMethod · 0.95
stampMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected