mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-15 11:25:53 +08:00
Use a manual hack to remove the canvas events for old MPL
This commit is contained in:
@@ -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