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

This commit is contained in:
Maciej Suminski 2014-08-04 10:06:24 +02:00
parent 3f8c091092
commit 03a17a284b
3 changed files with 21 additions and 4 deletions

View File

@ -832,8 +832,23 @@ void MODULE::ViewUpdate( int aUpdateFlags )
void MODULE::ViewGetLayers( int aLayers[], int& aCount ) const
{
aCount = 1;
aCount = 2;
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;
}
}

View File

@ -269,11 +269,13 @@ void PCB_DRAW_PANEL_GAL::SetHighContrastLayer( LAYER_ID aLayer )
if( aLayer == B_Cu )
{
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 ) );
}
else if( aLayer == F_Cu )
{
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 ) );
}
}

View File

@ -588,13 +588,13 @@ bool SELECTION_TOOL::selectable( const BOARD_ITEM* aItem ) const
int layers[KIGFX::VIEW::VIEW_MAX_LAYERS], layers_count;
// Filter out items that do not belong to active layers
std::set<unsigned int> activeLayers = getView()->GetPainter()->
const std::set<unsigned int>& activeLayers = getView()->GetPainter()->
GetSettings()->GetActiveLayers();
aItem->ViewGetLayers( layers, layers_count );
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;
break;