Browse Source

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
pull/13/head
Seth Hillbrand 7 years ago
parent
commit
ceca3e526c
  1. 2
      common/view/view.cpp

2
common/view/view.cpp

@ -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 );

Loading…
Cancel
Save