From ceca3e526c6b54e03d2e311769903c03f87a4d3b Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Thu, 4 Oct 2018 21:22:20 -0700 Subject: [PATCH] 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 --- common/view/view.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/view/view.cpp b/common/view/view.cpp index 22fe7fe671..364da756a6 100644 --- a/common/view/view.cpp +++ b/common/view/view.cpp @@ -451,7 +451,7 @@ int VIEW::Query( const BOX2I& aRect, std::vector& 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 > visitor( aResult, ( *i )->id );