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

Skip to content

Commit faa4816

Browse files
tacaswellksunden
authored andcommitted
FIX: handle the change detection differently for multicursor
There is not a singular canvas
1 parent 1ff61cf commit faa4816

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
@@ -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):

0 commit comments

Comments
 (0)
0