@@ -26,8 +26,8 @@ def _prevent_rasterization(draw):
26
26
# its draw method is explicitly decorated). If it is being drawn after a
27
27
# rasterized artist and it has reached a raster_depth of 0, we stop
28
28
# rasterization so that it does not affect the behavior of normal artist
29
- # (e.g., change in dpi). If the artist's draw method is decorated
30
- # (draw. _supports_rasterization is True ), it won't be decorated by
29
+ # (e.g., change in dpi). If the artist's draw method is decorated (has a
30
+ # ` _supports_rasterization` attribute ), it won't be decorated by
31
31
# `_prevent_rasterization`.
32
32
33
33
if hasattr (draw , "_supports_rasterization" ):
@@ -43,6 +43,7 @@ def draw_wrapper(artist, renderer):
43
43
44
44
return draw (artist , renderer )
45
45
46
+ draw_wrapper ._supports_rasterization = False
46
47
return draw_wrapper
47
48
48
49
@@ -128,11 +129,14 @@ class Artist:
128
129
zorder = 0
129
130
130
131
def __init_subclass__ (cls ):
131
- # Inject custom set() methods into the subclass with signature and
132
- # docstring based on the subclasses' properties.
133
132
133
+ # Decorate draw() method so that all artists are able to stop
134
+ # rastrization when necessary.
134
135
cls .draw = _prevent_rasterization (cls .draw )
135
136
137
+ # Inject custom set() methods into the subclass with signature and
138
+ # docstring based on the subclasses' properties.
139
+
136
140
if not hasattr (cls .set , '_autogenerated_signature' ):
137
141
# Don't overwrite cls.set if the subclass or one of its parents
138
142
# has defined a set method set itself.
0 commit comments