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

Method _rescale

Lib/turtle.py:754–764  ·  view source on GitHub ↗
(self, xscalefactor, yscalefactor)

Source from the content-addressed store, hash-verified

752 self.cv.config(scrollregion=(srx1, sry1, srx2, sry2))
753
754 def _rescale(self, xscalefactor, yscalefactor):
755 items = self.cv.find_all()
756 for item in items:
757 coordinates = list(self.cv.coords(item))
758 newcoordlist = []
759 while coordinates:
760 x, y = coordinates[:2]
761 newcoordlist.append(x * xscalefactor)
762 newcoordlist.append(y * yscalefactor)
763 coordinates = coordinates[2:]
764 self.cv.coords(item, *newcoordlist)
765
766 def _resize(self, canvwidth=None, canvheight=None, bg=None):
767 """Resize the canvas the turtles are drawing on. Does

Callers 1

setworldcoordinatesMethod · 0.45

Calls 4

listClass · 0.85
find_allMethod · 0.80
coordsMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected