Changed selection rules (pads&modules can be selected depending on the 'modules front/back' visibility instead of corresponding copper layers).

Fixed comments.
This commit is contained in:
Maciej Suminski 2013-12-05 14:52:08 +01:00
parent c5a1df6216
commit fc2d8e91c9
1 changed files with 11 additions and 11 deletions

View File

@ -458,20 +458,20 @@ bool SELECTION_TOOL::selectable( const BOARD_ITEM* aItem ) const
break; break;
case PCB_PAD_T: case PCB_PAD_T:
{
// Pads are not selectable in multiple selection mode // Pads are not selectable in multiple selection mode
if( m_multiple ) if( m_multiple )
return false; return false;
/* no break */
// Pads are supposed to be on top, bottom or both at the same time (THT) case PCB_MODULE_T:
if( aItem->IsOnLayer( LAYER_N_FRONT ) && board->IsLayerVisible( LAYER_N_FRONT ) ) if( aItem->IsOnLayer( LAYER_N_FRONT ) && board->IsElementVisible( MOD_FR_VISIBLE ) )
return true; return true;
if( aItem->IsOnLayer( LAYER_N_BACK ) && board->IsLayerVisible( LAYER_N_BACK ) ) if( aItem->IsOnLayer( LAYER_N_BACK ) && board->IsLayerVisible( MOD_BK_VISIBLE ) )
return true; return true;
return false; return false;
}
break; break;
case PCB_MODULE_TEXT_T: case PCB_MODULE_TEXT_T:
@ -483,7 +483,7 @@ bool SELECTION_TOOL::selectable( const BOARD_ITEM* aItem ) const
// These are not selectable, otherwise silkscreen drawings would be easily destroyed // These are not selectable, otherwise silkscreen drawings would be easily destroyed
case PCB_MODULE_EDGE_T: case PCB_MODULE_EDGE_T:
// and some other stuff that should be selected // and some other stuff that should not be selected
case NOT_USED: case NOT_USED:
case TYPE_NOT_INIT: case TYPE_NOT_INIT:
return false; return false;
@ -516,8 +516,8 @@ void SELECTION_TOOL::selectItem( BOARD_ITEM* aItem )
} }
} selectBase( m_selection ); } selectBase( m_selection );
// Modules are treated in a special way - when they are moved, we have to // Modules are treated in a special way - when they are selected, we have to
// move all the parts that make the module, not the module itself // select all the parts that make the module, not the module itself
if( aItem->Type() == PCB_MODULE_T ) if( aItem->Type() == PCB_MODULE_T )
{ {
MODULE* module = static_cast<MODULE*>( aItem ); MODULE* module = static_cast<MODULE*>( aItem );
@ -569,8 +569,8 @@ void SELECTION_TOOL::deselectItem( BOARD_ITEM* aItem )
} }
} deselectBase( m_selection ); } deselectBase( m_selection );
// Modules are treated in a special way - when they are moved, we have to // Modules are treated in a special way - when they are selected, we have to
// move all the parts that make the module, not the module itself // select all the parts that make the module, not the module itself
if( aItem->Type() == PCB_MODULE_T ) if( aItem->Type() == PCB_MODULE_T )
{ {
MODULE* module = static_cast<MODULE*>( aItem ); MODULE* module = static_cast<MODULE*>( aItem );