Don't hang when filling degenerate zones.

This commit is contained in:
Jeff Young 2022-09-15 18:15:48 +01:00
parent 8a0384e2f6
commit 19d8dcad8b
1 changed files with 5 additions and 0 deletions

View File

@ -154,6 +154,10 @@ bool ZONE_FILLER::Fill( std::vector<ZONE*>& aZones, bool aCheck, wxWindow* aPare
if( zone->GetIsRuleArea() ) if( zone->GetIsRuleArea() )
continue; continue;
// Degenerate zones will cause trouble; skip them
if( zone->GetNumCorners() <= 2 )
continue;
if( m_commit ) if( m_commit )
m_commit->Modify( zone ); m_commit->Modify( zone );
@ -243,6 +247,7 @@ bool ZONE_FILLER::Fill( std::vector<ZONE*>& aZones, bool aCheck, wxWindow* aPare
if( zoneLock.owns_lock() ) if( zoneLock.owns_lock() )
{ {
SHAPE_POLY_SET fillPolys; SHAPE_POLY_SET fillPolys;
if( !fillSingleZone( zone, layer, fillPolys ) ) if( !fillSingleZone( zone, layer, fillPolys ) )
return 0; return 0;