(self, gc)
| 555 | 6, [b"m", b"l", b"", b"c", b"cl"], True).decode("ascii") |
| 556 | |
| 557 | def _get_clip_cmd(self, gc): |
| 558 | clip = [] |
| 559 | rect = gc.get_clip_rectangle() |
| 560 | if rect is not None: |
| 561 | clip.append(f"{_nums_to_str(*rect.p0, *rect.size)} rectclip\n") |
| 562 | path, trf = gc.get_clip_path() |
| 563 | if path is not None: |
| 564 | key = (path, id(trf)) |
| 565 | custom_clip_cmd = self._clip_paths.get(key) |
| 566 | if custom_clip_cmd is None: |
| 567 | custom_clip_cmd = "c%d" % len(self._clip_paths) |
| 568 | self._pswriter.write(f"""\ |
| 569 | /{custom_clip_cmd} {{ |
| 570 | {self._convert_path(path, trf, simplify=False)} |
| 571 | clip |
| 572 | newpath |
| 573 | }} bind def |
| 574 | """) |
| 575 | self._clip_paths[key] = custom_clip_cmd |
| 576 | clip.append(f"{custom_clip_cmd}\n") |
| 577 | return "".join(clip) |
| 578 | |
| 579 | @_log_if_debug_on |
| 580 | def draw_image(self, gc, x, y, im, transform=None): |
no test coverage detected