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

Method _rescale

Python/Turtle.py:659–669  ·  view source on GitHub ↗
(self, xscalefactor, yscalefactor)

Source from the content-addressed store, hash-verified

657 self.cv.config(scrollregion=(srx1, sry1, srx2, sry2))
658
659 def _rescale(self, xscalefactor, yscalefactor):
660 items = self.cv.find_all()
661 for item in items:
662 coordinates = list(self.cv.coords(item))
663 newcoordlist = []
664 while coordinates:
665 x, y = coordinates[:2]
666 newcoordlist.append(x * xscalefactor)
667 newcoordlist.append(y * yscalefactor)
668 coordinates = coordinates[2:]
669 self.cv.coords(item, *newcoordlist)
670
671 def _resize(self, canvwidth=None, canvheight=None, bg=None):
672 """Resize the canvas the turtles are drawing on. Does

Callers 1

setworldcoordinatesMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected