Apply a big hammer for python script refreshing.
While not ideal, this should tide us over until we have a commit architecture for python scripts. Fixes https://gitlab.com/kicad/code/kicad/issues/7065
This commit is contained in:
parent
b2fa2f81b2
commit
f6c160eb50
|
@ -32,6 +32,7 @@
|
|||
|
||||
#include "pcbnew_scripting_helpers.h"
|
||||
|
||||
#include <tool/tool_manager.h>
|
||||
#include <action_plugin.h>
|
||||
#include <board.h>
|
||||
#include <board_design_settings.h>
|
||||
|
@ -358,12 +359,27 @@ void Refresh()
|
|||
{
|
||||
if( s_PcbEditFrame )
|
||||
{
|
||||
auto board = s_PcbEditFrame->GetBoard();
|
||||
TOOL_MANAGER* toolMgr = s_PcbEditFrame->GetToolManager();
|
||||
BOARD* board = s_PcbEditFrame->GetBoard();
|
||||
PCB_DRAW_PANEL_GAL* canvas = s_PcbEditFrame->GetCanvas();
|
||||
|
||||
canvas->SyncLayersVisibility( board );
|
||||
|
||||
canvas->GetView()->Clear();
|
||||
canvas->GetView()->InitPreview();
|
||||
canvas->GetGAL()->SetGridOrigin( VECTOR2D( board->GetDesignSettings().GetGridOrigin() ) );
|
||||
canvas->DisplayBoard( board );
|
||||
|
||||
// allow tools to re-add their view items (selection previews, grids, etc.)
|
||||
if( toolMgr )
|
||||
toolMgr->ResetTools( TOOL_BASE::GAL_SWITCH );
|
||||
|
||||
// reload the drawing-sheet
|
||||
s_PcbEditFrame->SetPageSettings( board->GetPageSettings() );
|
||||
|
||||
board->BuildConnectivity();
|
||||
|
||||
// Re-init everything: this is the easy way to do that
|
||||
s_PcbEditFrame->ActivateGalCanvas();
|
||||
s_PcbEditFrame->GetCanvas()->Refresh();
|
||||
canvas->Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue