view: Do not include hidden items in query

When querying the view, we do not want to including items that are not
on layers that are currently visible.  This routine is currently only
used by the selection tool (pcbnew and gerbview) and the grid helper.
Both expected this logic but were indifferent to the additional items.

Fixes: lp:1796403
* https://bugs.launchpad.net/kicad/+bug/1796403
This commit is contained in:
Seth Hillbrand 2018-10-04 21:22:20 -07:00
parent 4efc8dec88
commit ceca3e526c
1 changed files with 1 additions and 1 deletions

View File

@ -451,7 +451,7 @@ int VIEW::Query( const BOX2I& aRect, std::vector<LAYER_ITEM_PAIR>& aResult ) con
for( i = m_orderedLayers.rbegin(); i != m_orderedLayers.rend(); ++i )
{
// ignore layers that do not contain actual items (i.e. the selection box, menus, floats)
if( ( *i )->displayOnly )
if( ( *i )->displayOnly || !( *i )->visible )
continue;
queryVisitor<std::vector<LAYER_ITEM_PAIR> > visitor( aResult, ( *i )->id );