Skip to content

Commit

Permalink
Fixed another plotpy V1 regression (missing tools)
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreRaybaut committed Oct 18, 2023
1 parent 60989d6 commit a3aa0c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Empty file added .guidata_faulthandler.log
Empty file.
11 changes: 4 additions & 7 deletions plotpy/plot/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,10 @@ def add_tool(self, ToolKlass: GuiTool, *args, **kwargs) -> GuiTool:
# This is the very first tool to be added to this manager
self._first_tool_flag = False
self.configure_panels()
if not any(isinstance(x, ToolKlass) for x in self.tools):
tool = ToolKlass(self, *args, **kwargs)
self.tools.append(tool)
for plot in list(self.plots.values()):
tool.register_plot(plot)
else:
tool = self.get_tool(ToolKlass)
tool = ToolKlass(self, *args, **kwargs)
self.tools.append(tool)
for plot in list(self.plots.values()):
tool.register_plot(plot)
if len(self.tools) == 1 or self.default_tool is None:
self.default_tool = tool
return tool
Expand Down

0 comments on commit a3aa0c1

Please sign in to comment.