From 37f250b3841b097549d0246f798078a6f0b3ba0f Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Mon, 11 Mar 2019 17:07:00 -0700 Subject: [PATCH] pcbnew: Remove fills prior to updates Removing existing fills will prevent re-drawing invalid polygons before they are ready. This seems to happen on Macs more easily due to redraw timing. Fixes: lp:1819553 * https://bugs.launchpad.net/kicad/+bug/1819553 (cherry picked from commit 6006703798fa891ae89446928c6623ba7bdb0b57) --- pcbnew/zone_filler.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/pcbnew/zone_filler.cpp b/pcbnew/zone_filler.cpp index a7253746be..277c8abf6d 100644 --- a/pcbnew/zone_filler.cpp +++ b/pcbnew/zone_filler.cpp @@ -96,15 +96,12 @@ bool ZONE_FILLER::Fill( std::vector aZones, bool aCheck ) if( zone->GetIsKeepout() ) continue; - toFill.emplace_back( CN_ZONE_ISOLATED_ISLAND_LIST(zone) ); - } - - for( unsigned i = 0; i < toFill.size(); i++ ) - { if( m_commit ) - { - m_commit->Modify( toFill[i].m_zone ); - } + m_commit->Modify( zone ); + + // Remove existing fill first to prevent drawing invalid polygons + zone->UnFill(); + toFill.emplace_back( CN_ZONE_ISOLATED_ISLAND_LIST(zone) ); } if( m_progressReporter )