Revert change for 11299, and update removed-pad items after zone fills.

Fixes https://gitlab.com/kicad/code/kicad/issues/12645
This commit is contained in:
Jeff Young 2022-10-15 11:17:48 +01:00
parent b012cc1ac3
commit 4af98827fd
3 changed files with 38 additions and 7 deletions

View File

@ -613,7 +613,7 @@ bool PCB_VIA::FlashLayer( int aLayer ) const
// Must be static to keep from raising its ugly head in performance profiles
static std::initializer_list<KICAD_T> connectedTypes = { PCB_TRACE_T, PCB_ARC_T, PCB_VIA_T,
PCB_PAD_T };
PCB_PAD_T, PCB_ZONE_T, PCB_FP_ZONE_T };
// Do not check zones. Doing so results in race conditions when the via collides with
// two different zones of different priorities.

View File

@ -28,6 +28,8 @@
#include <connectivity/connectivity_data.h>
#include <board_commit.h>
#include <footprint.h>
#include <pcb_track.h>
#include <pad.h>
#include <pcb_group.h>
#include <board_design_settings.h>
#include <progress_reporter.h>
@ -96,7 +98,8 @@ void ZONE_FILLER_TOOL::CheckAllZones( wxWindow* aCaller, PROGRESS_REPORTER* aRep
board()->BuildConnectivity();
canvas()->Refresh();
refresh();
m_fillInProgress = false;
}
@ -174,7 +177,8 @@ void ZONE_FILLER_TOOL::FillAllZones( wxWindow* aCaller, PROGRESS_REPORTER* aRepo
if( filler.IsDebug() )
frame->UpdateUserInterface();
canvas()->Refresh();
refresh();
m_fillInProgress = false;
// wxWidgets has keyboard focus issues after the progress reporter. Re-setting the focus
@ -256,7 +260,8 @@ int ZONE_FILLER_TOOL::ZoneFillDirty( const TOOL_EVENT& aEvent )
if( filler.IsDebug() )
frame->UpdateUserInterface();
canvas()->Refresh();
refresh();
m_fillInProgress = false;
// wxWidgets has keyboard focus issues after the progress reporter. Re-setting the focus
@ -311,7 +316,8 @@ int ZONE_FILLER_TOOL::ZoneFill( const TOOL_EVENT& aEvent )
board()->BuildConnectivity( reporter.get() );
canvas()->Refresh();
refresh();
m_fillInProgress = false;
return 0;
}
@ -340,7 +346,8 @@ int ZONE_FILLER_TOOL::ZoneUnfill( const TOOL_EVENT& aEvent )
}
commit.Push( _( "Unfill Zone" ), ZONE_FILL_OP );
canvas()->Refresh();
refresh();
return 0;
}
@ -358,12 +365,34 @@ int ZONE_FILLER_TOOL::ZoneUnfillAll( const TOOL_EVENT& aEvent )
}
commit.Push( _( "Unfill All Zones" ), ZONE_FILL_OP );
canvas()->Refresh();
refresh();
return 0;
}
void ZONE_FILLER_TOOL::refresh()
{
canvas()->GetView()->UpdateAllItemsConditionally( KIGFX::REPAINT,
[&]( KIGFX::VIEW_ITEM* aItem ) -> bool
{
if( PCB_VIA* via = dynamic_cast<PCB_VIA*>( aItem ) )
{
return via->GetRemoveUnconnected();
}
else if( PAD* pad = dynamic_cast<PAD*>( aItem ) )
{
return pad->GetRemoveUnconnected();
}
return false;
} );
canvas()->Refresh();
}
void ZONE_FILLER_TOOL::setTransitions()
{
// Zone actions

View File

@ -68,6 +68,8 @@ private:
///< Refocus on an idle event (used after the Progress Reporter messes up the focus).
void singleShotRefocus( wxIdleEvent& );
void refresh();
///< Set up handlers for various events.
void setTransitions() override;