Skip to content

Commit 61e9da9

Browse files
committed
minor fix
1 parent 91814e8 commit 61e9da9

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

lib/matplotlib/artist.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ def _prevent_rasterization(draw):
2626
# its draw method is explicitly decorated). If it is being drawn after a
2727
# rasterized artist and it has reached a raster_depth of 0, we stop
2828
# 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
3131
# `_prevent_rasterization`.
3232

3333
if hasattr(draw, "_supports_rasterization"):
@@ -43,6 +43,7 @@ def draw_wrapper(artist, renderer):
4343

4444
return draw(artist, renderer)
4545

46+
draw_wrapper._supports_rasterization = False
4647
return draw_wrapper
4748

4849

@@ -128,11 +129,14 @@ class Artist:
128129
zorder = 0
129130

130131
def __init_subclass__(cls):
131-
# Inject custom set() methods into the subclass with signature and
132-
# docstring based on the subclasses' properties.
133132

133+
# Decorate draw() method so that all artists are able to stop
134+
# rastrization when necessary.
134135
cls.draw = _prevent_rasterization(cls.draw)
135136

137+
# Inject custom set() methods into the subclass with signature and
138+
# docstring based on the subclasses' properties.
139+
136140
if not hasattr(cls.set, '_autogenerated_signature'):
137141
# Don't overwrite cls.set if the subclass or one of its parents
138142
# has defined a set method set itself.

0 commit comments

Comments
 (0)