Make sure markers get removed from view when deleted.

This commit is contained in:
Jeff Young 2020-05-26 21:01:04 +01:00
parent 3ea093539b
commit 6ef6284924
2 changed files with 4 additions and 2 deletions

View File

@ -256,8 +256,6 @@ public:
virtual void CenterScreen( const wxPoint& aCenterPoint, bool aWarpPointer );
void FocusOnItem( SCH_ITEM* aItem );
void HardRedraw() override;
/**

View File

@ -372,11 +372,15 @@ void DIALOG_DRC::OnDRCItemRClick( wxDataViewEvent& aEvent )
bds().m_DRCSeverities[ rcItem->GetErrorCode() ] = RPT_SEVERITY_IGNORE;
std::vector<MARKER_PCB*>& markers = m_brdEditor->GetBoard()->Markers();
KIGFX::VIEW* view = m_parentFrame->GetToolManager()->GetView();
for( unsigned i = 0; i < markers.size(); )
{
if( markers[i]->GetRCItem()->GetErrorCode() == rcItem->GetErrorCode() )
{
view->Remove( markers.at( i ) );
markers.erase( markers.begin() + i );
}
else
++i;
}