BuildConnectivity and re-DisplayBoard in python Refresh function

Refresh is used in the python domain to refresh the display with the current
design. If something has changed, board connectivity likely needs rebuilding.
If using GAL canvas, update its display db.
This commit is contained in:
Miles McCoo 2017-12-03 11:19:42 +01:00 committed by Wayne Stambaugh
parent 8f0e6469ca
commit 5cc1cda29f
1 changed files with 8 additions and 0 deletions

View File

@ -39,6 +39,7 @@
#include <io_mgr.h>
#include <macros.h>
#include <stdlib.h>
#include <pcb_draw_panel_gal.h>
static PCB_EDIT_FRAME* s_PcbEditFrame = NULL;
@ -103,8 +104,15 @@ void Refresh()
{
if( s_PcbEditFrame )
{
auto board = s_PcbEditFrame->GetBoard();
board->BuildConnectivity();
if( s_PcbEditFrame->IsGalCanvasActive() )
{
auto panel = static_cast<PCB_DRAW_PANEL_GAL*>( s_PcbEditFrame->GetGalCanvas() );
panel->DisplayBoard(board);
s_PcbEditFrame->GetGalCanvas()->Refresh();
}
else
// first argument is erase background, second is a wxRect that
// defines a reftresh area (all canvas if null)