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):
2106
2106
2107
2107
def clear (self , event ):
2108
2108
"""Clear the cursor."""
2109
- if self .ignore (event ) or self . canvas is not self . ax . figure . canvas :
2109
+ if self .ignore (event ):
2110
2110
return
2111
2111
if self .useblit :
2112
2112
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
2113
2119
info ["background" ] = canvas .copy_from_bbox (canvas .figure .bbox )
2114
2120
2115
2121
def onmove (self , event ):
You can’t perform that action at this time.
0 commit comments