[reportlab-users] clipping path question
Thu, 5 Sep 2002 09:13:45 +0100
In article <GCEHJFIOJJCLBHMPNLGECEAACBAA.email@example.com>, Tiffany
Kamm <firstname.lastname@example.org> writes
>Can someone tell me how to clear the clipping path once it is set using
>canvas.clipPath(path)? (other than placing a save and restore state around
>it) I've been digging through docs and looking at the source code but I
>haven't seen what I'm looking for. shapes.py defines EmptyClipPath=Path()
>which I though perhaps I could pass into the clipPath method as my path and
>clear it that way. But, unfortunately it gives me an error:
> File "C:\Python22\reportlab\pdfgen\canvas.py", line 1276, in clipPath
> gc = aPath.getCode(); pathops = PATH_OPS[stroke, fill, self._fillMode]
>AttributeError: Path instance has no attribute 'getCode'
>Thanks in advance for any help.
this is currently an open question. I have implemented EmptyClipPath for
renderPM, but haven't got round to it in renderPDF/PS/SVG etc. The idea
is correct you assign EmptyClipPath to the clip path and it is cleared.
The problem is that normally that would require us to restoreState in
PDF so I have to ensure we saved one every time we do that (or