8000 FIX: handle the change detection differently for multicursor · matplotlib/matplotlib@9cec214 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9cec214

Browse files
committed
FIX: handle the change detection differently for multicursor
There is not a singular canvas
1 parent bf6bb31 commit 9cec214

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/matplotlib/widgets.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2128,10 +2128,16 @@ def clear(self, event):
21282128

21292129
def _clear(self, event):
21302130
"""Clear the cursor."""
2131-
if self.ignore(event) or self.canvas is not self.ax.figure.canvas:
2131+
if self.ignore(event):
21322132
return
21332133
if self.useblit:
21342134
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
21352141
info["background"] = canvas.copy_from_bbox(canvas.figure.bbox)
21362142

21372143
onmove = _api.deprecate_privatize_attribute('3.7')

0 commit comments

Comments
 (0)
0