diff --git a/common/jobs/job_export_pcb_pos.h b/common/jobs/job_export_pcb_pos.h index 4ca4f73dcc..4ca58d3575 100644 --- a/common/jobs/job_export_pcb_pos.h +++ b/common/jobs/job_export_pcb_pos.h @@ -29,12 +29,18 @@ class JOB_EXPORT_PCB_POS : public JOB { public: JOB_EXPORT_PCB_POS( bool aIsCli ) : - JOB( "pos", aIsCli ), m_filename(), + JOB( "pos", aIsCli ), + m_filename(), m_outputFile(), - m_excludeFootprintsWithTh( true ), m_useDrillPlaceFileOrigin( true ), - m_smdOnly( false ) + m_smdOnly( false ), + m_excludeFootprintsWithTh( false ), + m_negateBottomX( false ) { + m_side = SIDE::BOTH; + m_units = UNITS::MILLIMETERS; + m_format = FORMAT::ASCII; + m_gerberBoardEdge = true; } wxString m_filename; diff --git a/pcbnew/pcbnew_jobs_handler.cpp b/pcbnew/pcbnew_jobs_handler.cpp index b8dffdff28..84cf77ca64 100644 --- a/pcbnew/pcbnew_jobs_handler.cpp +++ b/pcbnew/pcbnew_jobs_handler.cpp @@ -434,10 +434,9 @@ int PCBNEW_JOBS_HANDLER::JobExportPos( JOB* aJob ) { PLACEFILE_GERBER_WRITER exporter( brd ); - PCB_LAYER_ID gbrLayer; - if( aPosJob->m_side == JOB_EXPORT_PCB_POS::SIDE::FRONT ) - gbrLayer = F_Cu; - else if( aPosJob->m_side == JOB_EXPORT_PCB_POS::SIDE::BACK ) + PCB_LAYER_ID gbrLayer = F_Cu; + + if( aPosJob->m_side == JOB_EXPORT_PCB_POS::SIDE::BACK ) gbrLayer = B_Cu; exporter.CreatePlaceFile( aPosJob->m_outputFile, gbrLayer, aPosJob->m_gerberBoardEdge ); diff --git a/pcbnew/tools/pcb_selection_tool.cpp b/pcbnew/tools/pcb_selection_tool.cpp index 20bd2b454e..5c157483fc 100644 --- a/pcbnew/tools/pcb_selection_tool.cpp +++ b/pcbnew/tools/pcb_selection_tool.cpp @@ -2485,7 +2485,7 @@ bool PCB_SELECTION_TOOL::Selectable( const BOARD_ITEM* aItem, bool checkVisibili if( !board()->IsLayerVisible( aItem->GetLayer() ) ) return false; - int controlLayer; + int controlLayer = UNDEFINED_LAYER; switch( static_cast( aItem )->GetType() ) { @@ -2494,6 +2494,9 @@ bool PCB_SELECTION_TOOL::Selectable( const BOARD_ITEM* aItem, bool checkVisibili case FP_TEXT::TEXT_is_DIVERS: controlLayer = LAYER_MOD_TEXT; break; } + if( controlLayer == UNDEFINED_LAYER ) + return false; + if( !view()->IsLayerVisible( controlLayer ) ) return false; }