Don't start filling zones with possibly stale caches.
Fixes https://gitlab.com/kicad/code/kicad/issues/8014
This commit is contained in:
parent
262badf6ea
commit
3279e295ac
|
@ -641,6 +641,8 @@ void DRC_ENGINE::InitEngine( const wxFileName& aRulePath )
|
||||||
|
|
||||||
m_constraintMap.clear();
|
m_constraintMap.clear();
|
||||||
|
|
||||||
|
m_board->IncrementTimeStamp(); // Clear board-level caches
|
||||||
|
|
||||||
try // attempt to load full set of rules (implicit + user rules)
|
try // attempt to load full set of rules (implicit + user rules)
|
||||||
{
|
{
|
||||||
loadImplicitRules();
|
loadImplicitRules();
|
||||||
|
|
|
@ -95,25 +95,28 @@ void ZONE_FILLER_TOOL::singleShotRefocus( wxIdleEvent& )
|
||||||
|
|
||||||
void ZONE_FILLER_TOOL::FillAllZones( wxWindow* aCaller, PROGRESS_REPORTER* aReporter )
|
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 );
|
BOARD_COMMIT commit( this );
|
||||||
|
std::vector<ZONE*> toFill;
|
||||||
|
|
||||||
for( ZONE* zone : board()->Zones() )
|
for( ZONE* zone : board()->Zones() )
|
||||||
toFill.push_back( zone );
|
toFill.push_back( zone );
|
||||||
|
|
||||||
|
board()->IncrementTimeStamp(); // Clear caches
|
||||||
|
|
||||||
ZONE_FILLER filler( board(), &commit );
|
ZONE_FILLER filler( board(), &commit );
|
||||||
|
|
||||||
if( !board()->GetDesignSettings().m_DRCEngine->RulesValid() )
|
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"),
|
wxHyperlinkCtrl* button = new wxHyperlinkCtrl( infobar, wxID_ANY, _("Show DRC rules"),
|
||||||
wxEmptyString );
|
wxEmptyString );
|
||||||
|
|
||||||
button->Bind( wxEVT_COMMAND_HYPERLINK, std::function<void( wxHyperlinkEvent& aEvent )>(
|
button->Bind( wxEVT_COMMAND_HYPERLINK,
|
||||||
|
std::function<void( wxHyperlinkEvent& aEvent )>(
|
||||||
[&]( wxHyperlinkEvent& aEvent )
|
[&]( wxHyperlinkEvent& aEvent )
|
||||||
{
|
{
|
||||||
getEditFrame<PCB_EDIT_FRAME>()->ShowBoardSetupDialog( _( "Rules" ) );
|
frame->ShowBoardSetupDialog( _( "Rules" ) );
|
||||||
} ) );
|
} ) );
|
||||||
|
|
||||||
infobar->RemoveAllButtons();
|
infobar->RemoveAllButtons();
|
||||||
|
@ -133,7 +136,7 @@ void ZONE_FILLER_TOOL::FillAllZones( wxWindow* aCaller, PROGRESS_REPORTER* aRepo
|
||||||
if( filler.Fill( toFill ) )
|
if( filler.Fill( toFill ) )
|
||||||
{
|
{
|
||||||
commit.Push( _( "Fill Zone(s)" ), true ); // Allow undoing zone fill
|
commit.Push( _( "Fill Zone(s)" ), true ); // Allow undoing zone fill
|
||||||
getEditFrame<PCB_EDIT_FRAME>()->m_ZoneFillsDirty = false;
|
frame->m_ZoneFillsDirty = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -141,7 +144,7 @@ void ZONE_FILLER_TOOL::FillAllZones( wxWindow* aCaller, PROGRESS_REPORTER* aRepo
|
||||||
}
|
}
|
||||||
|
|
||||||
if( filler.IsDebug() )
|
if( filler.IsDebug() )
|
||||||
getEditFrame<PCB_EDIT_FRAME>()->UpdateUserInterface();
|
frame->UpdateUserInterface();
|
||||||
|
|
||||||
canvas()->Refresh();
|
canvas()->Refresh();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue