diff options
author | ExMix <rahuba.youri@mapswithme.com> | 2013-06-27 16:15:01 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:57:21 +0300 |
commit | 366c57ac6a0c8ac48e22c8831b641a4afb3a979e (patch) | |
tree | 22920efe23a679cb518a32ab85fe6c96a6e3245d /gui | |
parent | 56c2974f149cc38c36bd9768d7097657dbe1b5f1 (diff) |
[fix]
- Sort gui elements by depth before select.
- Correct My position and Bookmark depth.
- Add ballon mode for show with bookmark padding and without.
Diffstat (limited to 'gui')
-rw-r--r-- | gui/controller.cpp | 10 | ||||
-rw-r--r-- | gui/display_list_cache.cpp | 3 |
2 files changed, 12 insertions, 1 deletions
diff --git a/gui/controller.cpp b/gui/controller.cpp index c9d228eeab..606ba0c556 100644 --- a/gui/controller.cpp +++ b/gui/controller.cpp @@ -43,11 +43,21 @@ namespace gui } } + namespace + { + bool DepthGreater(const shared_ptr<Element> & e1, + const shared_ptr<Element> & e2) + { + return e1->depth() > e2->depth(); + } + } + bool Controller::OnTapStarted(m2::PointD const & pt) { elem_list_t l; SelectElements(pt, l, true); + l.sort(DepthGreater); /// selecting first hit-tested element from the list if (!l.empty()) diff --git a/gui/display_list_cache.cpp b/gui/display_list_cache.cpp index 5174a11f36..80122db64d 100644 --- a/gui/display_list_cache.cpp +++ b/gui/display_list_cache.cpp @@ -2,6 +2,7 @@ #include "../graphics/display_list.hpp" #include "../graphics/glyph.hpp" +#include "../graphics/depth_constants.hpp" namespace gui { @@ -76,7 +77,7 @@ namespace gui /// @todo do not cache depth in display list. use separate vertex shader and uniform constant /// to specify it while rendering display list. - m_CacheScreen->drawSymbol(m2::PointD(0, 0), name, graphics::EPosAbove, graphics::maxDepth - 4); + m_CacheScreen->drawSymbol(m2::PointD(0, 0), name, graphics::EPosAbove, graphics::poiAndBookmarkDepth); m_CacheScreen->setDisplayList(0); m_CacheScreen->endFrame(); |