From b6e1b8b7b152ee770d211d26bd112d1fdf4708a1 Mon Sep 17 00:00:00 2001 From: Tom Date: Sat, 7 Mar 2026 01:50:03 +0100 Subject: [PATCH] fix: propagate board reload to project_commands after SVG logo import save_project uses project_commands.board, which was NOT in the propagation list after pcbnew.LoadBoard() in _handle_import_svg_logo. As a result, save_project() wrote the old in-memory board (without logo gr_poly entries) back to disk, erasing the logo every time. Fix: call _update_command_handlers() after reload, which updates all command handler board references including project_commands. --- python/kicad_interface.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/python/kicad_interface.py b/python/kicad_interface.py index 86eec53..3917ae5 100644 --- a/python/kicad_interface.py +++ b/python/kicad_interface.py @@ -1609,11 +1609,8 @@ class KiCADInterface: if result.get("success") and self.board: try: self.board = pcbnew.LoadBoard(pcb_path) - # Propagate to sub-command objects that hold a board reference - for attr in ("board_commands", "routing_commands", "component_commands"): - obj = getattr(self, attr, None) - if obj is not None: - obj.board = self.board + # Propagate updated board reference to all command handlers + self._update_command_handlers() logger.info("Reloaded board into pcbnew after SVG logo import") except Exception as reload_err: logger.warning(f"Board reload after SVG import failed (non-fatal): {reload_err}")