diff --git a/pcbnew/dialogs/dialog_block_options.cpp b/pcbnew/dialogs/dialog_block_options.cpp index 8d5ea00e3b..dcf611ceb4 100644 --- a/pcbnew/dialogs/dialog_block_options.cpp +++ b/pcbnew/dialogs/dialog_block_options.cpp @@ -36,6 +36,8 @@ DIALOG_BLOCK_OPTIONS::DIALOG_BLOCK_OPTIONS( PCB_BASE_FRAME* aParent, if( !aShowLegacyOptions ) { m_DrawBlockItems->Hide(); + m_checkBoxIncludeInvisible->Hide(); + m_staticline1->Hide(); } m_Include_Modules->SetValue( m_options.includeModules ); diff --git a/pcbnew/tools/selection_tool.cpp b/pcbnew/tools/selection_tool.cpp index 26c05c5948..14e00273e5 100644 --- a/pcbnew/tools/selection_tool.cpp +++ b/pcbnew/tools/selection_tool.cpp @@ -1235,20 +1235,20 @@ int SELECTION_TOOL::findMove( const TOOL_EVENT& aEvent ) */ static bool itemIsIncludedByFilter( const BOARD_ITEM& aItem, const BOARD& aBoard, - const LSET& aTechnlLayerMask, const DIALOG_BLOCK_OPTIONS::OPTIONS& aBlockOpts ) { bool include = true; const PCB_LAYER_ID layer = aItem.GetLayer(); // can skip without even checking item type + // fixme: selecting items on invisible layers does not work in GAL if( !aBlockOpts.includeItemsOnInvisibleLayers && !aBoard.IsLayerVisible( layer ) ) { include = false; } - // if the item needsto be checked agains the options + // if the item needs to be checked against the options if( include ) { switch( aItem.Type() ) @@ -1267,6 +1267,7 @@ static bool itemIsIncludedByFilter( const BOARD_ITEM& aItem, break; } case PCB_TRACE_T: + case PCB_VIA_T: { include = aBlockOpts.includeTracks; break; @@ -1280,18 +1281,20 @@ static bool itemIsIncludedByFilter( const BOARD_ITEM& aItem, case PCB_TARGET_T: case PCB_DIMENSION_T: { - include = aTechnlLayerMask[layer]; + if( layer == Edge_Cuts ) + include = aBlockOpts.includeBoardOutlineLayer; + else + include = aBlockOpts.includeItemsOnTechLayers; break; } case PCB_TEXT_T: { - include = aBlockOpts.includePcbTexts - && aTechnlLayerMask[layer]; + include = aBlockOpts.includePcbTexts; break; } default: { - // no filterering, just select it + // no filtering, just select it break; } } @@ -1301,24 +1304,6 @@ static bool itemIsIncludedByFilter( const BOARD_ITEM& aItem, } -/** - * Gets the technical layers that are part of the given selection opts - */ -static LSET getFilteredLayerSet( - const DIALOG_BLOCK_OPTIONS::OPTIONS& blockOpts ) -{ - LSET layerMask( Edge_Cuts ); - - if( blockOpts.includeItemsOnTechLayers ) - layerMask.set(); - - if( !blockOpts.includeBoardOutlineLayer ) - layerMask.set( Edge_Cuts, false ); - - return layerMask; -} - - int SELECTION_TOOL::filterSelection( const TOOL_EVENT& aEvent ) { auto& opts = m_priv->m_filterOpts; @@ -1330,7 +1315,6 @@ int SELECTION_TOOL::filterSelection( const TOOL_EVENT& aEvent ) return 0; const auto& board = *getModel(); - const auto layerMask = getFilteredLayerSet( opts ); // copy current selection auto selection = m_selection.GetItems(); @@ -1343,7 +1327,7 @@ int SELECTION_TOOL::filterSelection( const TOOL_EVENT& aEvent ) for( auto i : selection ) { auto item = static_cast( i ); - bool include = itemIsIncludedByFilter( *item, board, layerMask, opts ); + bool include = itemIsIncludedByFilter( *item, board, opts ); if( include ) {