Make module texts selectable if overlapping with module pads.
This commit is contained in:
parent
74584e2081
commit
656790a672
|
@ -1145,11 +1145,14 @@ void SELECTION_TOOL::guessSelectionCandidates( GENERAL_COLLECTOR& aCollector ) c
|
|||
for( int i = 0; i < aCollector.GetCount(); ++i )
|
||||
{
|
||||
BOARD_ITEM* item = aCollector[i];
|
||||
KICAD_T type = item->Type();
|
||||
|
||||
if ( item->Type() == PCB_MODULE_TEXT_T || item->Type() == PCB_TEXT_T || item->Type() == PCB_LINE_T )
|
||||
if ( silkLayers[item->GetLayer()] )
|
||||
if( ( type == PCB_MODULE_TEXT_T || type == PCB_TEXT_T || type == PCB_LINE_T )
|
||||
&& silkLayers[item->GetLayer()] )
|
||||
{
|
||||
preferred.insert( item );
|
||||
}
|
||||
}
|
||||
|
||||
if( preferred.size() != 0 )
|
||||
{
|
||||
|
@ -1164,6 +1167,7 @@ void SELECTION_TOOL::guessSelectionCandidates( GENERAL_COLLECTOR& aCollector ) c
|
|||
if( aCollector.CountType( PCB_MODULE_TEXT_T ) > 0 )
|
||||
{
|
||||
for( int i = 0; i < aCollector.GetCount(); ++i )
|
||||
{
|
||||
if( TEXTE_MODULE* txt = dyn_cast<TEXTE_MODULE*>( aCollector[i] ) )
|
||||
{
|
||||
double textArea = calcArea( txt );
|
||||
|
@ -1185,7 +1189,8 @@ void SELECTION_TOOL::guessSelectionCandidates( GENERAL_COLLECTOR& aCollector ) c
|
|||
case PCB_LINE_T:
|
||||
case PCB_VIA_T:
|
||||
case PCB_MODULE_T:
|
||||
if( areaRatio > textToFeatureMinRatio )
|
||||
if( areaRatio > textToFeatureMinRatio &&
|
||||
!txt->GetParent()->ViewBBox().Contains( txt->ViewBBox() ) )
|
||||
{
|
||||
rejected.insert( txt );
|
||||
}
|
||||
|
@ -1196,6 +1201,7 @@ void SELECTION_TOOL::guessSelectionCandidates( GENERAL_COLLECTOR& aCollector ) c
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( aCollector.CountType( PCB_MODULE_T ) > 0 )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue