From 1ee5d809edfdd56c08adad417c269160e887f09b Mon Sep 17 00:00:00 2001 From: Daria Volvenkova Date: Thu, 24 Nov 2016 14:08:04 +0300 Subject: [PATCH] Fixed selection of area titles. --- drape/overlay_handle.hpp | 1 + drape/overlay_tree.cpp | 6 +++--- drape_frontend/path_text_shape.cpp | 5 +++++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/drape/overlay_handle.hpp b/drape/overlay_handle.hpp index 78e9224192..930ad547b2 100644 --- a/drape/overlay_handle.hpp +++ b/drape/overlay_handle.hpp @@ -81,6 +81,7 @@ public: virtual uint64_t GetPriorityInFollowingMode() const; virtual bool IsBound() const { return false; } + virtual bool HasLinearFeatureShape() const { return false; } virtual bool Enable3dExtention() const { return true; } diff --git a/drape/overlay_tree.cpp b/drape/overlay_tree.cpp index 8f7a0ecc87..429cb1c4bf 100644 --- a/drape/overlay_tree.cpp +++ b/drape/overlay_tree.cpp @@ -214,7 +214,7 @@ void OverlayTree::InsertHandle(ref_ptr handle, bool rejectByDepth = false; if (!rejectBySelected && modelView.isPerspective()) { - bool const pathTextComparation = handle->HasDynamicAttributes() || rivalHandle->HasDynamicAttributes(); + bool const pathTextComparation = handle->HasLinearFeatureShape() || rivalHandle->HasLinearFeatureShape(); rejectByDepth = !pathTextComparation && handleToCompare->GetPivot(modelView, true).y > rivalHandle->GetPivot(modelView, true).y; } @@ -395,7 +395,7 @@ void OverlayTree::Select(m2::PointD const & glbPoint, TOverlayContainer & result for (auto const & handle : m_handlesCache) { - if (!handle->HasDynamicAttributes() && rect.IsPointInside(handle->GetPivot(screen, false))) + if (!handle->HasLinearFeatureShape() && rect.IsPointInside(handle->GetPivot(screen, false))) result.push_back(handle); } } @@ -405,7 +405,7 @@ void OverlayTree::Select(m2::RectD const & rect, TOverlayContainer & result) con ScreenBase screen = m_traits.m_modelView; ForEachInRect(rect, [&](ref_ptr const & h) { - if (!h->HasDynamicAttributes() && h->IsVisible() && h->GetFeatureID().IsValid()) + if (!h->HasLinearFeatureShape() && h->IsVisible() && h->GetFeatureID().IsValid()) { OverlayHandle::Rects shape; h->GetPixelShape(screen, screen.isPerspective(), shape); diff --git a/drape_frontend/path_text_shape.cpp b/drape_frontend/path_text_shape.cpp index 2c3048b9d3..bf357e00cc 100644 --- a/drape_frontend/path_text_shape.cpp +++ b/drape_frontend/path_text_shape.cpp @@ -185,6 +185,11 @@ public: return m_priorityFollowingMode; } + bool HasLinearFeatureShape() const override + { + return true; + } + private: bool CalculatePerspectiveOffsets(const m2::Spline & pixelSpline, float & pixelOffset) const {