Exemplo n.º 1
0
    def drawPath(self, path):
        c = self._canvas
        if path is EmptyClipPath:
            del c._clipPaths[-1]
            if c._clipPaths:
                P = c._clipPaths[-1]
                icp = P.isClipPath
                P.isClipPath = 1
                self.drawPath(P)
                P.isClipPath = icp
            else:
                c.clipPathClear()
            return
        c.pathBegin()
        drawFuncs = (c.moveTo, c.lineTo, c.curveTo, c.pathClose)
        from reportlab.graphics.shapes import _renderPath

        isClosed = _renderPath(path, drawFuncs)
        if path.isClipPath:
            c.clipPathSet()
            c._clipPaths.append(path)
        else:
            if isClosed:
                c.pathFill()
            c.pathStroke()
Exemplo n.º 2
0
 def drawPath(self, path):
     from reportlab.graphics.shapes import _renderPath
     c = self._canvas
     drawFuncs = (c.moveTo, c.lineTo, c.curveTo, c.closePath)
     isClosed = _renderPath(path, drawFuncs)
     if not isClosed:
         c._fillColor = None
     c._fillAndStroke([], clip=path.isClipPath)
Exemplo n.º 3
0
 def drawPath(self, path):
     # print "### drawPath", path.points
     from reportlab.graphics.shapes import _renderPath
     c = self._canvas
     drawFuncs = (c.moveTo, c.lineTo, c.curveTo, c.closePath)
     isClosed = _renderPath(path, drawFuncs)
     if isClosed:
         #Only try and add links to closed paths...
         link_info = self._get_link_info_dict(path)
     else :
         c._fillColor = None
         link_info = None
     c._fillAndStroke([], clip=path.isClipPath, link_info=link_info)
 def drawPath(self, path):
     # print "### drawPath", path.points
     from reportlab.graphics.shapes import _renderPath
     c = self._canvas
     drawFuncs = (c.moveTo, c.lineTo, c.curveTo, c.closePath)
     isClosed = _renderPath(path, drawFuncs)
     if isClosed:
         #Only try and add links to closed paths...
         link_info = self._get_link_info_dict(path)
     else :
         c._fillColor = None
         link_info = None
     c._fillAndStroke([], clip=path.isClipPath, link_info=link_info)
 def drawPath(self, path):
     from reportlab.graphics.shapes import _renderPath
     pdfPath = self._canvas.beginPath()
     drawFuncs = (pdfPath.moveTo, pdfPath.lineTo, pdfPath.curveTo,
                  pdfPath.close)
     isClosed = _renderPath(path, drawFuncs)
     if isClosed:
         fill = self._fill
     else:
         fill = 0
     if path.isClipPath:
         self._canvas.clipPath(pdfPath, fill=fill, stroke=self._stroke)
     else:
         self._canvas.drawPath(pdfPath, fill=fill, stroke=self._stroke)
Exemplo n.º 6
0
    def drawPath(self, path):
        from reportlab.graphics.shapes import _renderPath

        pdfPath = self._canvas.beginPath()
        drawFuncs = (pdfPath.moveTo, pdfPath.lineTo, pdfPath.curveTo, pdfPath.close)
        isClosed = _renderPath(path, drawFuncs)
        if isClosed:
            fill = self._fill
        else:
            fill = 0
        if path.isClipPath:
            self._canvas.clipPath(pdfPath, fill=fill, stroke=self._stroke)
        else:
            self._canvas.drawPath(pdfPath, fill=fill, stroke=self._stroke)
Exemplo n.º 7
0
 def drawPath(self, path):
     c = self._canvas
     if path is EmptyClipPath:
         del c._clipPaths[-1]
         if c._clipPaths:
             P = c._clipPaths[-1]
             icp = P.isClipPath
             P.isClipPath = 1
             self.drawPath(P)
             P.isClipPath = icp
         else:
             c.clipPathClear()
         return
     c.pathBegin()
     drawFuncs = (c.moveTo, c.lineTo, c.curveTo, c.pathClose)
     from reportlab.graphics.shapes import _renderPath
     isClosed = _renderPath(path, drawFuncs)
     if path.isClipPath:
         c.clipPathSet()
         c._clipPaths.append(path)
     else:
         if isClosed: c.pathFill()
         c.pathStroke()
Exemplo n.º 8
0
 def drawPath(self, path):
     from reportlab.graphics.shapes import _renderPath
     pdfPath = self._canvas.beginPath()
     drawFuncs = (pdfPath.moveTo, pdfPath.lineTo, pdfPath.curveTo, pdfPath.close)
     autoclose = getattr(path,'autoclose','')
     fill = self._fill
     stroke = self._stroke
     isClosed = _renderPath(path, drawFuncs, forceClose=fill and autoclose=='pdf')
     dP = self._canvas.drawPath
     cP = self._canvas.clipPath if path.isClipPath else dP
     fillMode = getattr(path,'fillMode',None)
     if autoclose=='svg':
         if fill and stroke and not isClosed:
             cP(pdfPath, fill=fill, stroke=0)
             dP(pdfPath, stroke=stroke, fill=0, fillMode=fillMode)
         else:
             cP(pdfPath, fill=fill, stroke=stroke, fillMode=fillMode)
     elif autoclose=='pdf':
         cP(pdfPath, fill=fill, stroke=stroke, fillMode=fillMode)
     else:
         #our old broken default
         if not isClosed:
             fill = 0
         cP(pdfPath, fill=fill, stroke=stroke, fillMode=fillMode)
Exemplo n.º 9
0
 def drawPath(self, path):
     from reportlab.graphics.shapes import _renderPath
     pdfPath = self._canvas.beginPath()
     drawFuncs = (pdfPath.moveTo, pdfPath.lineTo, pdfPath.curveTo, pdfPath.close)
     autoclose = getattr(path,'autoclose','')
     fill = self._fill
     stroke = self._stroke
     isClosed = _renderPath(path, drawFuncs, forceClose=fill and autoclose=='pdf')
     dP = self._canvas.drawPath
     cP = self._canvas.clipPath if path.isClipPath else dP
     fillMode = getattr(path,'fillMode',None)
     if autoclose=='svg':
         if fill and stroke and not isClosed:
             cP(pdfPath, fill=fill, stroke=0)
             dP(pdfPath, stroke=stroke, fill=0, fillMode=fillMode)
         else:
             cP(pdfPath, fill=fill, stroke=stroke, fillMode=fillMode)
     elif autoclose=='pdf':
         cP(pdfPath, fill=fill, stroke=stroke, fillMode=fillMode)
     else:
         #our old broken default
         if not isClosed:
             fill = 0
         cP(pdfPath, fill=fill, stroke=stroke, fillMode=fillMode)
Exemplo n.º 10
0
 def rP(forceClose=False):
     c.pathBegin()
     return _renderPath(path, drawFuncs, forceClose=forceClose)
Exemplo n.º 11
0
 def rP(**kwds):
     return _renderPath(path, drawFuncs, **kwds)
Exemplo n.º 12
0
 def rP(forceClose=False):
     c.pathBegin()
     return _renderPath(path, drawFuncs, forceClose=forceClose)