File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -2128,10 +2128,16 @@ def clear(self, event):
2128
2128
2129
2129
def _clear (self , event ):
2130
2130
"""Clear the cursor."""
2131
- if self .ignore (event ) or self . canvas is not self . ax . figure . canvas :
2131
+ if self .ignore (event ):
2132
2132
return
2133
2133
if self .useblit :
2134
2134
for canvas , info in self ._canvas_infos .items ():
2135
+ # someone has switched the canvas on us! This happens if
2136
+ # `savefig` needs to save to a format the previous backend did
2137
+ # not support (e.g. saving a figure using an Agg based backend
2138
+ # saved to a vector format).
2139
+ if canvas is not canvas .figure .canvas :
2140
+ continue
2135
2141
info ["background" ] = canvas .copy_from_bbox (canvas .figure .bbox )
2136
2142
2137
2143
onmove = _api .deprecate_privatize_attribute ('3.7' )
You can’t perform that action at this time.
0 commit comments