From ee95224517a87dcec96d8d8403d75d1dae30894f Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Thu, 25 Aug 2022 08:54:34 -0700 Subject: [PATCH] Ensure that teardrops always get filled first Teardrops are, by definition, higher priority than standard zones, so ensure that they cannot be overriden --- pcbnew/zone.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pcbnew/zone.cpp b/pcbnew/zone.cpp index b2c3cf4bb3..dfd2ab69c5 100644 --- a/pcbnew/zone.cpp +++ b/pcbnew/zone.cpp @@ -180,6 +180,14 @@ EDA_ITEM* ZONE::Clone() 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( m_teardropType ) > static_cast( aOther->m_teardropType ); + } + if( m_priority != aOther->m_priority ) return m_priority > aOther->m_priority;