Commit fc2d8e91 authored by Maciej Suminski's avatar Maciej Suminski

Changed selection rules (pads&modules can be selected depending on the...

Changed selection rules (pads&modules can be selected depending on the 'modules front/back' visibility instead of corresponding copper layers).
Fixed comments.
parent c5a1df62
...@@ -458,20 +458,20 @@ bool SELECTION_TOOL::selectable( const BOARD_ITEM* aItem ) const ...@@ -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 ...@@ -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 ) ...@@ -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 ) ...@@ -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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment