diff --git a/pcbnew/dialogs/dialog_drc.cpp b/pcbnew/dialogs/dialog_drc.cpp index 42e176595c..d8696b365b 100644 --- a/pcbnew/dialogs/dialog_drc.cpp +++ b/pcbnew/dialogs/dialog_drc.cpp @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include #include @@ -332,15 +332,24 @@ void DIALOG_DRC::OnDRCItemRClick( wxDataViewEvent& aEvent ) switch( GetPopupMenuSelectionFromUser( menu ) ) { case 1: - node->m_RcItem->GetParent()->SetExcluded( false ); + { + MARKER_PCB* marker = dynamic_cast( node->m_RcItem->GetParent() ); + + marker->SetExcluded( false ); + m_brdEditor->GetCanvas()->GetView()->Update( marker ); // Update view static_cast( aEvent.GetModel() )->ValueChanged( node ); modified = true; + } break; case 2: - node->m_RcItem->GetParent()->SetExcluded( true ); + { + MARKER_PCB* marker = dynamic_cast( node->m_RcItem->GetParent() ); + + marker->SetExcluded( true ); + m_brdEditor->GetCanvas()->GetView()->Update( marker ); // Update view if( m_severities & RPT_SEVERITY_EXCLUSION ) @@ -349,11 +358,18 @@ void DIALOG_DRC::OnDRCItemRClick( wxDataViewEvent& aEvent ) static_cast( aEvent.GetModel() )->DeleteCurrentItem( false ); modified = true; + } break; case 3: bds().m_DRCSeverities[ rcItem->GetErrorCode() ] = RPT_SEVERITY_ERROR; + for( MARKER_PCB* marker : m_brdEditor->GetBoard()->Markers() ) + { + if( marker->GetRCItem()->GetErrorCode() == rcItem->GetErrorCode() ) + m_brdEditor->GetCanvas()->GetView()->Update( marker ); + } + // Rebuild model and view static_cast( aEvent.GetModel() )->SetProvider( m_markersProvider ); modified = true; @@ -362,6 +378,12 @@ void DIALOG_DRC::OnDRCItemRClick( wxDataViewEvent& aEvent ) case 4: bds().m_DRCSeverities[ rcItem->GetErrorCode() ] = RPT_SEVERITY_WARNING; + for( MARKER_PCB* marker : m_brdEditor->GetBoard()->Markers() ) + { + if( marker->GetRCItem()->GetErrorCode() == rcItem->GetErrorCode() ) + m_brdEditor->GetCanvas()->GetView()->Update( marker ); + } + // Rebuild model and view static_cast( aEvent.GetModel() )->SetProvider( m_markersProvider ); modified = true; @@ -372,13 +394,12 @@ void DIALOG_DRC::OnDRCItemRClick( wxDataViewEvent& aEvent ) bds().m_DRCSeverities[ rcItem->GetErrorCode() ] = RPT_SEVERITY_IGNORE; std::vector& 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 ) ); + m_brdEditor->GetCanvas()->GetView()->Remove( markers.at( i ) ); markers.erase( markers.begin() + i ); } else @@ -399,6 +420,7 @@ void DIALOG_DRC::OnDRCItemRClick( wxDataViewEvent& aEvent ) if( modified ) { updateDisplayedCounts(); + refreshBoardEditor(); m_brdEditor->OnModify(); m_brdEditor->SyncToolbars(); }