diff --git a/gerbview/gerbview_painter.cpp b/gerbview/gerbview_painter.cpp index 982cff9bf9..874d640df6 100644 --- a/gerbview/gerbview_painter.cpp +++ b/gerbview/gerbview_painter.cpp @@ -104,6 +104,15 @@ void GERBVIEW_RENDER_SETTINGS::LoadDisplayOptions( const GBR_DISPLAY_OPTIONS& aO } +void GERBVIEW_RENDER_SETTINGS::ClearHighlightSelections() +{ + // Clear all highlight selections (dcode, net, component, attribute selection) + m_componentHighlightString.Empty(); + m_netHighlightString.Empty(); + m_attributeHighlightString.Empty(); + m_dcodeHighlightValue = -1; +} + COLOR4D GERBVIEW_RENDER_SETTINGS::GetColor( const VIEW_ITEM* aItem, int aLayer ) const { const EDA_ITEM* item = dynamic_cast( aItem ); diff --git a/gerbview/gerbview_painter.h b/gerbview/gerbview_painter.h index 9401beb4db..688b0f4531 100644 --- a/gerbview/gerbview_painter.h +++ b/gerbview/gerbview_painter.h @@ -129,6 +129,9 @@ public: return m_diffMode; } + /// Clear all highlight selections (dcode, net, component, attribute selection) + void ClearHighlightSelections(); + /// If set to anything but an empty string, will highlight items with matching component wxString m_componentHighlightString; diff --git a/gerbview/tools/gerbview_control.cpp b/gerbview/tools/gerbview_control.cpp index f1385dd8c8..6a8b9928f6 100644 --- a/gerbview/tools/gerbview_control.cpp +++ b/gerbview/tools/gerbview_control.cpp @@ -165,10 +165,7 @@ int GERBVIEW_CONTROL::HighlightControl( const TOOL_EVENT& aEvent ) m_frame->m_SelNetnameBox->SetSelection( 0 ); m_frame->m_SelAperAttributesBox->SetSelection( 0 ); - settings->m_netHighlightString = ""; - settings->m_componentHighlightString = ""; - settings->m_attributeHighlightString = ""; - settings->m_dcodeHighlightValue = -1; + settings->ClearHighlightSelections(); GERBER_FILE_IMAGE* gerber = m_frame->GetGbrImage( m_frame->GetActiveLayer() ); @@ -321,6 +318,11 @@ int GERBVIEW_CONTROL::ClearAllLayers( const TOOL_EVENT& aEvent ) canvas()->Refresh(); m_frame->ClearMsgPanel(); + // Clear pending highlight selections, now outdated + KIGFX::GERBVIEW_RENDER_SETTINGS* settings = + static_cast( getView()->GetPainter() )->GetSettings(); + settings->ClearHighlightSelections(); + return 0; }