Skip to content

Commit a3aa0c1

Browse files
committed
Fixed another plotpy V1 regression (missing tools)
1 parent 60989d6 commit a3aa0c1

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

.guidata_faulthandler.log

Whitespace-only changes.

plotpy/plot/manager.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -203,13 +203,10 @@ def add_tool(self, ToolKlass: GuiTool, *args, **kwargs) -> GuiTool:
203203
# This is the very first tool to be added to this manager
204204
self._first_tool_flag = False
205205
self.configure_panels()
206-
if not any(isinstance(x, ToolKlass) for x in self.tools):
207-
tool = ToolKlass(self, *args, **kwargs)
208-
self.tools.append(tool)
209-
for plot in list(self.plots.values()):
210-
tool.register_plot(plot)
211-
else:
212-
tool = self.get_tool(ToolKlass)
206+
tool = ToolKlass(self, *args, **kwargs)
207+
self.tools.append(tool)
208+
for plot in list(self.plots.values()):
209+
tool.register_plot(plot)
213210
if len(self.tools) == 1 or self.default_tool is None:
214211
self.default_tool = tool
215212
return tool

0 commit comments

Comments
 (0)