Update the given GraphicsContext with the given dict of properties. The keys in the dictionary are used to identify the appropriate ``set_`` method on the *gc*.
(self, gc, new_gc_dict)
| 37 | *map(renderer.points_to_pixels, self._offset)) |
| 38 | |
| 39 | def _update_gc(self, gc, new_gc_dict): |
| 40 | """ |
| 41 | Update the given GraphicsContext with the given dict of properties. |
| 42 | |
| 43 | The keys in the dictionary are used to identify the appropriate |
| 44 | ``set_`` method on the *gc*. |
| 45 | """ |
| 46 | new_gc_dict = new_gc_dict.copy() |
| 47 | |
| 48 | dashes = new_gc_dict.pop("dashes", None) |
| 49 | if dashes: |
| 50 | gc.set_dashes(**dashes) |
| 51 | |
| 52 | for k, v in new_gc_dict.items(): |
| 53 | set_method = getattr(gc, 'set_' + k, None) |
| 54 | if not callable(set_method): |
| 55 | raise AttributeError(f'Unknown property {k}') |
| 56 | set_method(v) |
| 57 | return gc |
| 58 | |
| 59 | def draw_path(self, renderer, gc, tpath, affine, rgbFace=None): |
| 60 | """ |