(self)
| 639 | return {'clip-path': f'url(#{oid})'} |
| 640 | |
| 641 | def _write_clips(self): |
| 642 | if not len(self._clipd): |
| 643 | return |
| 644 | writer = self.writer |
| 645 | writer.start('defs') |
| 646 | for clip, oid in self._clipd.values(): |
| 647 | writer.start('clipPath', id=oid) |
| 648 | if len(clip) == 2: |
| 649 | clippath, clippath_trans = clip |
| 650 | path_data = self._convert_path( |
| 651 | clippath, clippath_trans, simplify=False) |
| 652 | writer.element('path', d=path_data) |
| 653 | else: |
| 654 | x, y, w, h = clip |
| 655 | writer.element( |
| 656 | 'rect', |
| 657 | x=_short_float_fmt(x), |
| 658 | y=_short_float_fmt(y), |
| 659 | width=_short_float_fmt(w), |
| 660 | height=_short_float_fmt(h)) |
| 661 | writer.end('clipPath') |
| 662 | writer.end('defs') |
| 663 | |
| 664 | def open_group(self, s, gid=None): |
| 665 | # docstring inherited |
no test coverage detected