diff --git a/gerbview/tools/gerbview_selection_tool.cpp b/gerbview/tools/gerbview_selection_tool.cpp index b8c126df7a..0b66fe7cad 100644 --- a/gerbview/tools/gerbview_selection_tool.cpp +++ b/gerbview/tools/gerbview_selection_tool.cpp @@ -657,7 +657,10 @@ EDA_ITEM* GERBVIEW_SELECTION_TOOL::disambiguationMenu( GERBER_COLLECTOR* aCollec bool GERBVIEW_SELECTION_TOOL::selectable( const EDA_ITEM* aItem ) const { - auto item = static_cast( aItem ); + GERBVIEW_FRAME* frame = getEditFrame(); + const GERBER_DRAW_ITEM* item = static_cast( aItem ); + int layer = item->GetLayer(); + if( item->GetLayerPolarity() ) { @@ -667,7 +670,11 @@ bool GERBVIEW_SELECTION_TOOL::selectable( const EDA_ITEM* aItem ) const return false; } - return getEditFrame()->IsLayerVisible( item->GetLayer() ); + // We do not want to select items that are in the background + if( frame->m_DisplayOptions.m_HighContrastMode && layer != frame->GetActiveLayer() ) + return false; + + return frame->IsLayerVisible( layer ); }