Remove extra canvas redraws when changing sheets.

This commit is contained in:
Alex 2023-03-05 04:33:07 +03:00
parent c1f4911d7e
commit d2bd7e33b9
4 changed files with 16 additions and 7 deletions

View File

@ -1415,8 +1415,6 @@ void SCH_EDIT_FRAME::RefreshOperatingPointDisplay()
}
}
}
GetCanvas()->Refresh();
}
@ -1998,7 +1996,13 @@ void SCH_EDIT_FRAME::DisplayCurrentSheet()
wxASSERT( screen );
SetScreen( screen );
if( m_toolManager )
m_toolManager->RunAction( EE_ACTIONS::clearSelection, true );
SCH_BASE_FRAME::SetScreen( screen );
if( m_toolManager )
m_toolManager->ResetTools( TOOL_BASE::MODEL_RELOAD );
// update the References
GetCurrentSheet().UpdateAllScreenReferences();
@ -2043,7 +2047,7 @@ void SCH_EDIT_FRAME::DisplayCurrentSheet()
{
// Set zoom to last used in this screen
GetCanvas()->GetView()->SetScale( GetScreen()->m_LastZoomLevel );
RedrawScreen( GetScreen()->m_ScrollCenter, false );
GetCanvas()->GetView()->SetCenter( GetScreen()->m_ScrollCenter );
}
updateTitle();

View File

@ -2167,7 +2167,7 @@ bool SIMULATOR_FRAME::LoadWorkbook( const wxString& aPath )
LoadSimulator();
rebuildSignalsList();
rebuildSignalsGrid( m_filter->GetValue() );
updateSignalsGrid();
updateCursors();
@ -2407,6 +2407,7 @@ void SIMULATOR_FRAME::onPlotClosed( wxAuiNotebookEvent& event )
SCHEMATIC& schematic = m_schematicFrame->Schematic();
schematic.ClearOperatingPoints();
m_schematicFrame->RefreshOperatingPointDisplay();
m_schematicFrame->GetCanvas()->Refresh();
}
} );
}
@ -2910,6 +2911,7 @@ void SIMULATOR_FRAME::onSimFinished( wxCommandEvent& aEvent )
}
m_schematicFrame->RefreshOperatingPointDisplay();
m_schematicFrame->GetCanvas()->Refresh();
updateCursors();

View File

@ -2155,6 +2155,7 @@ int SCH_EDITOR_CONTROL::ToggleOPVoltages( const TOOL_EVENT& aEvent )
getView()->SetLayerVisible( LAYER_OP_VOLTAGES, cfg->m_Appearance.show_op_voltages );
m_frame->RefreshOperatingPointDisplay();
m_frame->GetCanvas()->Refresh();
return 0;
}
@ -2167,6 +2168,7 @@ int SCH_EDITOR_CONTROL::ToggleOPCurrents( const TOOL_EVENT& aEvent )
getView()->SetLayerVisible( LAYER_OP_CURRENTS, cfg->m_Appearance.show_op_currents );
m_frame->RefreshOperatingPointDisplay();
m_frame->GetCanvas()->Refresh();
return 0;
}

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2019 CERN
* Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -261,6 +261,7 @@ void SCH_NAVIGATE_TOOL::changeSheet( SCH_SHEET_PATH aPath )
pushToHistory( aPath );
m_frame->SetCurrentSheet( aPath );
m_frame->FocusOnItem( nullptr );
m_frame->Schematic().SetCurrentSheet( aPath );
m_frame->DisplayCurrentSheet();
}