MCPcopy Create free account
hub / github.com/Distrotech/reportlab / drawOn

Method drawOn

tools/pythonpoint/pythonpoint.py:837–856  ·  view source on GitHub ↗
(self, canv)

Source from the content-addressed store, hash-verified

835 self.lineWidth=0
836
837 def drawOn(self, canv):
838 canv.saveState()
839 canv.setLineWidth(self.lineWidth)
840 if self.strokeColor:
841 r,g,b = checkColor(self.strokeColor)
842 canv.setStrokeColorRGB(r,g,b)
843 if self.fillColor:
844 r,g,b = checkColor(self.fillColor)
845 canv.setFillColorRGB(r,g,b)
846
847 path = canv.beginPath()
848 (x,y) = self.points[0]
849 path.moveTo(x,y)
850 for (x,y) in self.points[1:]:
851 path.lineTo(x,y)
852 path.close()
853 canv.drawPath(path,
854 stroke=(self.strokeColor<>None),
855 fill=(self.fillColor<>None))
856 canv.restoreState()
857
858
859class PPString:

Callers

nothing calls this directly

Calls 11

checkColorFunction · 0.85
setStrokeColorRGBMethod · 0.80
setFillColorRGBMethod · 0.80
beginPathMethod · 0.80
saveStateMethod · 0.45
setLineWidthMethod · 0.45
moveToMethod · 0.45
lineToMethod · 0.45
closeMethod · 0.45
drawPathMethod · 0.45
restoreStateMethod · 0.45

Tested by

no test coverage detected