Context manager to temporary disable drawing. This is used for getting the drawn size of Artists. This lets us run the draw process to update any Python state but does not pay the cost of the draw_XYZ calls on the canvas.
(self)
| 680 | """ |
| 681 | |
| 682 | def _draw_disabled(self): |
| 683 | """ |
| 684 | Context manager to temporary disable drawing. |
| 685 | |
| 686 | This is used for getting the drawn size of Artists. This lets us |
| 687 | run the draw process to update any Python state but does not pay the |
| 688 | cost of the draw_XYZ calls on the canvas. |
| 689 | """ |
| 690 | no_ops = { |
| 691 | meth_name: functools.update_wrapper(lambda *args, **kwargs: None, |
| 692 | getattr(RendererBase, meth_name)) |
| 693 | for meth_name in dir(RendererBase) |
| 694 | if (meth_name.startswith("draw_") |
| 695 | or meth_name in ["open_group", "close_group"]) |
| 696 | } |
| 697 | |
| 698 | return _setattr_cm(self, **no_ops) |
| 699 | |
| 700 | |
| 701 | class GraphicsContextBase: |
no test coverage detected