Use action to change current sheet.

That way it gets into the navigation hierarchy,
the current zoom gets saved, etc.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20466
This commit is contained in:
Jeff Young
2025-03-27 17:56:53 +00:00
parent c67924ccac
commit 7ba07a3bb0
6 changed files with 15 additions and 30 deletions
+3 -5
View File
@@ -27,6 +27,7 @@
#include <schematic.h>
#include <tools/sch_find_replace_tool.h>
#include <sch_sheet_path.h>
#include "sch_actions.h"
int SCH_FIND_REPLACE_TOOL::FindAndReplace( const TOOL_EVENT& aEvent )
@@ -290,11 +291,8 @@ int SCH_FIND_REPLACE_TOOL::FindNext( const TOOL_EVENT& aEvent )
{
if( m_frame->Schematic().CurrentSheet() != sheet )
{
// Store the current zoom level into the current screen before switching
m_frame->GetScreen()->m_LastZoomLevel = m_frame->GetCanvas()->GetView()->GetScale();
m_frame->Schematic().SetCurrentSheet( sheet );
m_frame->DisplayCurrentSheet();
m_frame->GetToolManager()->RunAction<SCH_SHEET_PATH*>( SCH_ACTIONS::changeSheet,
&sheet );
}
break;