We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1ff61cf commit faa4816Copy full SHA for faa4816
1 file changed
lib/matplotlib/widgets.py
@@ -2106,10 +2106,16 @@ def disconnect(self):
2106
2107
def clear(self, event):
2108
"""Clear the cursor."""
2109
- if self.ignore(event) or self.canvas is not self.ax.figure.canvas:
+ if self.ignore(event):
2110
return
2111
if self.useblit:
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
2119
info["background"] = canvas.copy_from_bbox(canvas.figure.bbox)
2120
2121
def onmove(self, event):
0 commit comments