MCPcopy Create free account
hub / github.com/PageBot/PageBot / scale

Method scale

Lib/pagebot/contexts/basecontext/basecontext.py:757–768  ·  view source on GitHub ↗

Sets the drawing scale.

(self, sx=1, sy=None, center=(0, 0))

Source from the content-addressed store, hash-verified

755 self.b.rotate(angle, center=center)
756
757 def scale(self, sx=1, sy=None, center=(0, 0)):
758 """Sets the drawing scale."""
759 if isinstance(sx, (tuple, list)):
760 assert len(sx) in (2, 3)
761 sx, sy = sx[0], sx[1] # FIXME: where are sz and s?
762
763 if sy is None:
764 sy = sx
765
766 msg = 'DrawBotContext.scale: Values (%s, %s) must all be of numbers'
767 assert isinstance(sx, (int, float)) and isinstance(sy, (int, float)), (msg % (sx, sy))
768 self.b.scale(sx, sy, center=center)
769
770 def skew(self, angle1, angle2=0, center=(0, 0)):
771 return self.b.skew(angle1, angle2=angle2, center=center)

Callers 2

drawPathMethod · 0.95
drawGlyphMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected