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

Method _getshapepoly

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

2878 # else return None
2879
2880 def _getshapepoly(self, polygon, compound=False):
2881 """Calculate transformed shape polygon according to resizemode
2882 and shapetransform.
2883 """
2884 if self._resizemode == "user" or compound:
2885 t11, t12, t21, t22 = self._shapetrafo
2886 elif self._resizemode == "auto":
2887 l = max(1, self._pensize/5.0)
2888 t11, t12, t21, t22 = l, 0, 0, l
2889 elif self._resizemode == "noresize":
2890 return polygon
2891 return tuple((t11*x + t12*y, t21*x + t22*y) for (x, y) in polygon)
2892
2893 def _drawturtle(self):
2894 """Manages the correct rendering of the turtle with respect to

Callers 3

get_shapepolyMethod · 0.95
_drawturtleMethod · 0.95
stampMethod · 0.95

Calls 1

maxFunction · 0.50

Tested by

no test coverage detected