(self, gc)
| 486 | _writeln(self.fh, r"\end{pgfscope}") |
| 487 | |
| 488 | def _print_pgf_clip(self, gc): |
| 489 | f = 1. / self.dpi |
| 490 | # check for clip box |
| 491 | bbox = gc.get_clip_rectangle() |
| 492 | if bbox: |
| 493 | p1, p2 = bbox.get_points() |
| 494 | w, h = p2 - p1 |
| 495 | coords = p1[0] * f, p1[1] * f, w * f, h * f |
| 496 | _writeln(self.fh, |
| 497 | r"\pgfpathrectangle" |
| 498 | r"{\pgfqpoint{%fin}{%fin}}{\pgfqpoint{%fin}{%fin}}" |
| 499 | % coords) |
| 500 | _writeln(self.fh, r"\pgfusepath{clip}") |
| 501 | |
| 502 | # check for clip path |
| 503 | clippath, clippath_trans = gc.get_clip_path() |
| 504 | if clippath is not None: |
| 505 | self._print_pgf_path(gc, clippath, clippath_trans) |
| 506 | _writeln(self.fh, r"\pgfusepath{clip}") |
| 507 | |
| 508 | def _print_pgf_path_styles(self, gc, rgbFace): |
| 509 | # cap style |
no test coverage detected