GerbView: fix a few issues with layer selection / info synchronization

Fixes: lp:1754135
* https://bugs.launchpad.net/kicad/+bug/1754135
This commit is contained in:
Jon Evans 2018-03-08 18:19:38 -05:00
parent ad5311f393
commit e4b847b345
2 changed files with 5 additions and 9 deletions

View File

@ -206,7 +206,6 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( KIWAY* aKiway, wxWindow* aParent ):
SetActiveLayer( 0, true );
Zoom_Automatique( false ); // Gives a default zoom value
UpdateTitleAndInfo();
EDA_DRAW_PANEL_GAL::GAL_TYPE canvasType = loadCanvasTypeSetting();
@ -333,7 +332,7 @@ bool GERBVIEW_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
int layer = 0;
for( unsigned i=0; i<limit; ++i, ++layer )
for( unsigned i = 0; i < limit; ++i, ++layer )
{
SetActiveLayer( layer );
@ -353,8 +352,6 @@ bool GERBVIEW_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
Zoom_Automatique( true ); // Zoom fit in frame
UpdateTitleAndInfo();
return true;
}
@ -576,7 +573,6 @@ int GERBVIEW_FRAME::getNextAvailableLayer( int aLayer ) const
void GERBVIEW_FRAME::syncLayerWidget()
{
m_LayersManager->SelectLayer( GetActiveLayer() );
UpdateTitleAndInfo();
}
@ -599,8 +595,6 @@ void GERBVIEW_FRAME::syncLayerBox( bool aRebuildLayerBox )
m_DCodeSelector->SetDCodeSelection( dcodeSelected );
m_DCodeSelector->Enable( gerber != NULL );
}
UpdateTitleAndInfo();
}
@ -978,6 +972,8 @@ void GERBVIEW_FRAME::SetActiveLayer( int aLayer, bool doLayerWidgetUpdate )
if( doLayerWidgetUpdate )
m_LayersManager->SelectLayer( GetActiveLayer() );
UpdateTitleAndInfo();
if( IsGalCanvasActive() )
{
m_toolManager->RunAction( GERBVIEW_ACTIONS::layerChanged ); // notify other tools

View File

@ -195,10 +195,10 @@ bool GERBVIEW_FRAME::LoadGerberJobFile( const wxString& aFullFileName )
}
}
Zoom_Automatique( false );
SortLayersByX2Attributes();
SetActiveLayer( 0 );
if( !msg.IsEmpty() )
{
wxSafeYield(); // Allows slice of time to redraw the screen