Don't start filling zones with possibly stale caches.

Fixes https://gitlab.com/kicad/code/kicad/issues/8014
This commit is contained in:
Jeff Young 2021-03-25 17:19:29 +00:00
parent 262badf6ea
commit 3279e295ac
2 changed files with 15 additions and 10 deletions

View File

@ -641,6 +641,8 @@ void DRC_ENGINE::InitEngine( const wxFileName& aRulePath )
m_constraintMap.clear();
m_board->IncrementTimeStamp(); // Clear board-level caches
try // attempt to load full set of rules (implicit + user rules)
{
loadImplicitRules();

View File

@ -95,25 +95,28 @@ void ZONE_FILLER_TOOL::singleShotRefocus( wxIdleEvent& )
void ZONE_FILLER_TOOL::FillAllZones( wxWindow* aCaller, PROGRESS_REPORTER* aReporter )
{
std::vector<ZONE*> toFill;
PCB_EDIT_FRAME* frame = getEditFrame<PCB_EDIT_FRAME>();
BOARD_COMMIT commit( this );
std::vector<ZONE*> toFill;
for( ZONE* zone : board()->Zones() )
toFill.push_back( zone );
board()->IncrementTimeStamp(); // Clear caches
ZONE_FILLER filler( board(), &commit );
if( !board()->GetDesignSettings().m_DRCEngine->RulesValid() )
{
WX_INFOBAR* infobar = frame()->GetInfoBar();
WX_INFOBAR* infobar = frame->GetInfoBar();
wxHyperlinkCtrl* button = new wxHyperlinkCtrl( infobar, wxID_ANY, _("Show DRC rules"),
wxEmptyString );
button->Bind( wxEVT_COMMAND_HYPERLINK, std::function<void( wxHyperlinkEvent& aEvent )>(
button->Bind( wxEVT_COMMAND_HYPERLINK,
std::function<void( wxHyperlinkEvent& aEvent )>(
[&]( wxHyperlinkEvent& aEvent )
{
getEditFrame<PCB_EDIT_FRAME>()->ShowBoardSetupDialog( _( "Rules" ) );
frame->ShowBoardSetupDialog( _( "Rules" ) );
} ) );
infobar->RemoveAllButtons();
@ -133,7 +136,7 @@ void ZONE_FILLER_TOOL::FillAllZones( wxWindow* aCaller, PROGRESS_REPORTER* aRepo
if( filler.Fill( toFill ) )
{
commit.Push( _( "Fill Zone(s)" ), true ); // Allow undoing zone fill
getEditFrame<PCB_EDIT_FRAME>()->m_ZoneFillsDirty = false;
frame->m_ZoneFillsDirty = false;
}
else
{
@ -141,7 +144,7 @@ void ZONE_FILLER_TOOL::FillAllZones( wxWindow* aCaller, PROGRESS_REPORTER* aRepo
}
if( filler.IsDebug() )
getEditFrame<PCB_EDIT_FRAME>()->UpdateUserInterface();
frame->UpdateUserInterface();
canvas()->Refresh();