Browse Source

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

Fixes: lp:1754135
* https://bugs.launchpad.net/kicad/+bug/1754135
pull/5/merge
Jon Evans 8 years ago
parent
commit
e4b847b345
  1. 10
      gerbview/gerbview_frame.cpp
  2. 4
      gerbview/job_file_reader.cpp

10
gerbview/gerbview_frame.cpp

@ -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

4
gerbview/job_file_reader.cpp

@ -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

Loading…
Cancel
Save