Browse Source

bugfix: modules are not selectable in the high contrast mode (GAL).

pull/1/head
Maciej Suminski 12 years ago
parent
commit
03a17a284b
  1. 17
      pcbnew/class_module.cpp
  2. 2
      pcbnew/pcb_draw_panel_gal.cpp
  3. 6
      pcbnew/tools/selection_tool.cpp

17
pcbnew/class_module.cpp

@ -832,8 +832,23 @@ void MODULE::ViewUpdate( int aUpdateFlags )
void MODULE::ViewGetLayers( int aLayers[], int& aCount ) const void MODULE::ViewGetLayers( int aLayers[], int& aCount ) const
{ {
aCount = 1;
aCount = 2;
aLayers[0] = ITEM_GAL_LAYER( ANCHOR_VISIBLE ); aLayers[0] = ITEM_GAL_LAYER( ANCHOR_VISIBLE );
switch( m_Layer )
{
case F_Cu:
aLayers[1] = ITEM_GAL_LAYER( MOD_FR_VISIBLE );
break;
case B_Cu:
aLayers[1] = ITEM_GAL_LAYER( MOD_BK_VISIBLE );
break;
default:
assert( false ); // do you really have modules placed on inner layers?
break;
}
} }

2
pcbnew/pcb_draw_panel_gal.cpp

@ -269,11 +269,13 @@ void PCB_DRAW_PANEL_GAL::SetHighContrastLayer( LAYER_ID aLayer )
if( aLayer == B_Cu ) if( aLayer == B_Cu )
{ {
rSettings->SetActiveLayer( ITEM_GAL_LAYER( PAD_BK_VISIBLE ) ); rSettings->SetActiveLayer( ITEM_GAL_LAYER( PAD_BK_VISIBLE ) );
rSettings->SetActiveLayer( ITEM_GAL_LAYER( MOD_BK_VISIBLE ) );
rSettings->SetActiveLayer( NETNAMES_GAL_LAYER( PAD_BK_NETNAMES_VISIBLE ) ); rSettings->SetActiveLayer( NETNAMES_GAL_LAYER( PAD_BK_NETNAMES_VISIBLE ) );
} }
else if( aLayer == F_Cu ) else if( aLayer == F_Cu )
{ {
rSettings->SetActiveLayer( ITEM_GAL_LAYER( PAD_FR_VISIBLE ) ); rSettings->SetActiveLayer( ITEM_GAL_LAYER( PAD_FR_VISIBLE ) );
rSettings->SetActiveLayer( ITEM_GAL_LAYER( MOD_FR_VISIBLE ) );
rSettings->SetActiveLayer( NETNAMES_GAL_LAYER( PAD_FR_NETNAMES_VISIBLE ) ); rSettings->SetActiveLayer( NETNAMES_GAL_LAYER( PAD_FR_NETNAMES_VISIBLE ) );
} }
} }

6
pcbnew/tools/selection_tool.cpp

@ -588,13 +588,13 @@ bool SELECTION_TOOL::selectable( const BOARD_ITEM* aItem ) const
int layers[KIGFX::VIEW::VIEW_MAX_LAYERS], layers_count; int layers[KIGFX::VIEW::VIEW_MAX_LAYERS], layers_count;
// Filter out items that do not belong to active layers // Filter out items that do not belong to active layers
std::set<unsigned int> activeLayers = getView()->GetPainter()->
GetSettings()->GetActiveLayers();
const std::set<unsigned int>& activeLayers = getView()->GetPainter()->
GetSettings()->GetActiveLayers();
aItem->ViewGetLayers( layers, layers_count ); aItem->ViewGetLayers( layers, layers_count );
for( int i = 0; i < layers_count; ++i ) for( int i = 0; i < layers_count; ++i )
{ {
if( activeLayers.count( layers[i] ) > 0 ) // Item is on at least one of active layers
if( activeLayers.count( layers[i] ) > 0 ) // Item is on at least one of the active layers
{ {
onActive = true; onActive = true;
break; break;

Loading…
Cancel
Save