From 7160c3f57e7145f78cd40c3541cc06d4c4dad992 Mon Sep 17 00:00:00 2001 From: rachytski Date: Thu, 28 Jun 2012 17:44:19 -0700 Subject: [PATCH] fixed bug with "frozen screen while navigating". --- gui/controller.cpp | 6 +++--- gui/controller.hpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gui/controller.cpp b/gui/controller.cpp index 24d20541ce..5d8cb73e37 100644 --- a/gui/controller.cpp +++ b/gui/controller.cpp @@ -28,14 +28,14 @@ namespace gui Controller::~Controller() {} - void Controller::SelectElements(m2::PointD const & pt, elem_list_t & l) + void Controller::SelectElements(m2::PointD const & pt, elem_list_t & l, bool onlyVisible) { for (elem_list_t::const_iterator it = m_Elements.begin(); it != m_Elements.end(); ++it) { shared_ptr const & e = *it; - if (e->roughHitTest(pt) && e->hitTest(pt)) + if ((!onlyVisible || e->isVisible()) && e->roughHitTest(pt) && e->hitTest(pt)) l.push_back(e); } } @@ -44,7 +44,7 @@ namespace gui { elem_list_t l; - SelectElements(pt, l); + SelectElements(pt, l, true); /// selecting first hit-tested element from the list if (!l.empty()) diff --git a/gui/controller.hpp b/gui/controller.hpp index 09c7725c35..2ef10978a1 100644 --- a/gui/controller.hpp +++ b/gui/controller.hpp @@ -43,7 +43,7 @@ namespace gui elem_list_t m_Elements; /// select elements under specified point - void SelectElements(m2::PointD const & pt, elem_list_t & l); + void SelectElements(m2::PointD const & pt, elem_list_t & l, bool onlyVisible); /// Invalidate GUI function TInvalidateFn m_InvalidateFn;