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 @@ -2106,10 +2106,16 @@ def disconnect(self):
21062106
21072107 def clear (self , event ):
21082108 """Clear the cursor."""
2109- if self .ignore (event ) or self . canvas is not self . ax . figure . canvas :
2109+ if self .ignore (event ):
21102110 return
21112111 if self .useblit :
21122112 for canvas , info in self ._canvas_infos .items ():
2113+ # someone has switched the canvas on us! This happens if
2114+ # `savefig` needs to save to a format the previous backend did
2115+ # not support (e.g. saving a figure using an Agg based backend
2116+ # saved to a vector format).
2117+ if canvas is not canvas .figure .canvas :
2118+ continue
21132119 info ["background" ] = canvas .copy_from_bbox (canvas .figure .bbox )
21142120
21152121 def onmove (self , event ):
You can’t perform that action at this time.
0 commit comments