Only consider pins on this unit as clickable anchors

Fixes https://gitlab.com/kicad/code/kicad/-/issues/7987
This commit is contained in:
Jon Evans 2021-03-21 19:18:13 -04:00
parent 9ce34102af
commit f7c20c6bef
1 changed files with 12 additions and 1 deletions

View File

@ -1886,9 +1886,20 @@ void SCH_COMPONENT::ClearBrightenedPins()
bool SCH_COMPONENT::IsPointClickableAnchor( const wxPoint& aPos ) const bool SCH_COMPONENT::IsPointClickableAnchor( const wxPoint& aPos ) const
{ {
for( auto& pin : m_pins ) for( const std::unique_ptr<SCH_PIN>& pin : m_pins )
{
int pin_unit = pin->GetLibPin()->GetUnit();
int pin_convert = pin->GetLibPin()->GetConvert();
if( pin_unit > 0 && pin_unit != GetUnit() )
continue;
if( pin_convert > 0 && pin_convert != GetConvert() )
continue;
if( pin->IsPointClickableAnchor( aPos ) ) if( pin->IsPointClickableAnchor( aPos ) )
return true; return true;
}
return false; return false;
} }