mirror of
https://github.com/wassname/scikit-image.git
synced 2026-10-30 13:40:44 +08:00
Use a manual hack to remove the canvas events for old MPL
This commit is contained in:
1 parent
532e460172
commit
72292f73c0
1 file changed
+5
-2
@@ -51,8 +51,11 @@ class RectangleTool(CanvasToolBase, RectangleSelector):
|
||||
RectangleSelector.__init__(self, self.ax, lambda *args: None,
|
||||
rectprops=props)
|
||||
# Events are handled by the viewer
|
||||
for c in self.cids:
|
||||
self.canvas.mpl_disconnect(c)
|
||||
try:
|
||||
self.disconnect_events()
|
||||
except AttributeError:
|
||||
# disconnect the events manually (hack for older mpl verions)
|
||||
[self.canvas.mpl_disconnect(i) for i in range(5)]
|
||||
|
||||
# Alias rectangle attribute, which is initialized in RectangleSelector.
|
||||
self._rect = self.to_draw
|
||||
|
||||
Reference in new issue
Block a user