Browse Source

Gerbview: clear all previous highlight selections, after clearing all layers.

Fixes #8893
https://gitlab.com/kicad/code/kicad/issues/8893
6.0.7
jean-pierre charras 4 years ago
parent
commit
1dbd4fcb7d
  1. 9
      gerbview/gerbview_painter.cpp
  2. 3
      gerbview/gerbview_painter.h
  3. 10
      gerbview/tools/gerbview_control.cpp

9
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<const EDA_ITEM*>( aItem );

3
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;

10
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<KIGFX::GERBVIEW_PAINTER*>( getView()->GetPainter() )->GetSettings();
settings->ClearHighlightSelections();
return 0;
}

Loading…
Cancel
Save