Skip to content

Commit eaf59b5

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

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/matplotlib/widgets.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2128,10 +2128,13 @@ 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!
2136+
if canvas is not canvas.figure.canvas:
2137+
continue
21352138
info["background"] = canvas.copy_from_bbox(canvas.figure.bbox)
21362139

21372140
onmove = _api.deprecate_privatize_attribute('3.7')

0 commit comments

Comments
 (0)