(self, gc)
| 616 | return _generate_css(self._get_style_dict(gc, rgbFace)) |
| 617 | |
| 618 | def _get_clip_attrs(self, gc): |
| 619 | cliprect = gc.get_clip_rectangle() |
| 620 | clippath, clippath_trans = gc.get_clip_path() |
| 621 | if clippath is not None: |
| 622 | clippath_trans = self._make_flip_transform(clippath_trans) |
| 623 | dictkey = (self._get_clippath_id(clippath), str(clippath_trans)) |
| 624 | elif cliprect is not None: |
| 625 | x, y, w, h = cliprect.bounds |
| 626 | y = self.height-(y+h) |
| 627 | dictkey = (x, y, w, h) |
| 628 | else: |
| 629 | return {} |
| 630 | clip = self._clipd.get(dictkey) |
| 631 | if clip is None: |
| 632 | oid = self._make_id('p', dictkey) |
| 633 | if clippath is not None: |
| 634 | self._clipd[dictkey] = ((clippath, clippath_trans), oid) |
| 635 | else: |
| 636 | self._clipd[dictkey] = (dictkey, oid) |
| 637 | else: |
| 638 | _, oid = clip |
| 639 | return {'clip-path': f'url(#{oid})'} |
| 640 | |
| 641 | def _write_clips(self): |
| 642 | if not len(self._clipd): |
no test coverage detected