Ensure that teardrops always get filled first

Teardrops are, by definition, higher priority than standard zones, so
ensure that they cannot be overriden
This commit is contained in:
Seth Hillbrand 2022-08-25 08:54:34 -07:00
parent 418df36790
commit ee95224517
1 changed files with 8 additions and 0 deletions

View File

@ -180,6 +180,14 @@ EDA_ITEM* ZONE::Clone() const
bool ZONE::HigherPriority( const ZONE* aOther ) const bool ZONE::HigherPriority( const ZONE* aOther ) const
{ {
// Teardrops are always higher priority than regular zones, so if one zone is a teardrop
// and the other is not, then return higher priority as the teardrop
if( ( m_teardropType == TEARDROP_TYPE::TD_NONE )
^ ( aOther->m_teardropType == TEARDROP_TYPE::TD_NONE ) )
{
return static_cast<int>( m_teardropType ) > static_cast<int>( aOther->m_teardropType );
}
if( m_priority != aOther->m_priority ) if( m_priority != aOther->m_priority )
return m_priority > aOther->m_priority; return m_priority > aOther->m_priority;