File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -132,7 +132,9 @@ def __init_subclass__(cls):
132132
133133 # Decorate draw() method so that all artists are able to stop
134134 # rastrization when necessary.
135- cls .draw = _prevent_rasterization (cls .draw )
135+
136+ if not hasattr (cls .draw , "_supports_rasterization" ):
137+ cls .draw = _prevent_rasterization (cls .draw )
136138
137139 # Inject custom set() methods into the subclass with signature and
138140 # docstring based on the subclasses' properties.
Original file line number Diff line number Diff line change @@ -535,3 +535,17 @@ def test_format_cursor_data_BoundaryNorm():
535535 assert img .format_cursor_data (v ) == label
536536
537537 plt .close ()
538+
539+
540+ def test_auto_no_rasterize ():
541+ class Gen1 (martist .Artist ):
542+ ...
543+
544+ assert 'draw' in Gen1 .__dict__
545+ assert Gen1 .__dict__ ['draw' ] is Gen1 .draw
546+
547+ class Gen2 (Gen1 ):
548+ ...
549+
550+ assert 'draw' not in Gen2 .__dict__
551+ assert Gen2 .draw is Gen1 .draw
You can’t perform that action at this time.
0 commit comments