diff options
author | r.kuznetsov <r.kuznetsov@corp.mail.ru> | 2015-07-06 16:03:39 +0300 |
---|---|---|
committer | r.kuznetsov <r.kuznetsov@corp.mail.ru> | 2015-11-30 16:09:29 +0300 |
commit | 3d6b3cde35b48eeb84e6d217027d3c6a7c6d398d (patch) | |
tree | 8eb1a4e40a84aaf437ff148d14f411c825cc55e3 /drape | |
parent | 80c864685038b34af3ff742329581633ef8eeedb (diff) |
Fixed bug with path texts and removed isValid flag
Diffstat (limited to 'drape')
-rw-r--r-- | drape/overlay_handle.cpp | 1 | ||||
-rw-r--r-- | drape/overlay_handle.hpp | 8 | ||||
-rw-r--r-- | drape/overlay_tree.cpp | 12 | ||||
-rw-r--r-- | drape/overlay_tree.hpp | 3 | ||||
-rw-r--r-- | drape/render_bucket.cpp | 15 |
5 files changed, 12 insertions, 27 deletions
diff --git a/drape/overlay_handle.cpp b/drape/overlay_handle.cpp index 4d622ea5b6..a517e21d4b 100644 --- a/drape/overlay_handle.cpp +++ b/drape/overlay_handle.cpp @@ -26,7 +26,6 @@ OverlayHandle::OverlayHandle(FeatureID const & id, , m_anchor(anchor) , m_priority(priority) , m_isVisible(false) - , m_isValid(true) { } diff --git a/drape/overlay_handle.hpp b/drape/overlay_handle.hpp index cd38cc01f6..e05ff00f24 100644 --- a/drape/overlay_handle.hpp +++ b/drape/overlay_handle.hpp @@ -31,11 +31,9 @@ public: bool IsVisible() const; void SetIsVisible(bool isVisible); - bool IsValid() const { return m_isValid; } - m2::PointD GetPivot(ScreenBase const & screen) const; - virtual void Update(ScreenBase const & /*screen*/) {} + virtual bool Update(ScreenBase const & /*screen*/) { return true; } virtual m2::RectD GetPixelRect(ScreenBase const & screen) const = 0; virtual void GetPixelShape(ScreenBase const & screen, Rects & rects) const = 0; @@ -55,9 +53,6 @@ public: double const & GetPriority() const; protected: - void SetIsValid(bool isValid) { m_isValid = isValid; } - -protected: FeatureID const m_id; dp::Anchor const m_anchor; double const m_priority; @@ -67,7 +62,6 @@ protected: private: bool m_isVisible; - bool m_isValid; dp::IndexStorage m_indexes; struct LessOffsetNode diff --git a/drape/overlay_tree.cpp b/drape/overlay_tree.cpp index 2b75ade6a8..3c8044961b 100644 --- a/drape/overlay_tree.cpp +++ b/drape/overlay_tree.cpp @@ -25,22 +25,20 @@ void OverlayTree::ForceUpdate() m_frameCounter = -1; } -void OverlayTree::StartOverlayPlacing(ScreenBase const & screen, bool canOverlap) +void OverlayTree::StartOverlayPlacing(ScreenBase const & screen) { ASSERT(IsNeedUpdate(), ()); Clear(); m_traits.m_modelView = screen; - m_canOverlap = canOverlap; } void OverlayTree::Add(ref_ptr<OverlayHandle> handle, bool isTransparent) { ScreenBase const & modelView = GetModelView(); - handle->SetIsVisible(m_canOverlap); - handle->Update(modelView); + handle->SetIsVisible(false); - if (!handle->IsValid()) + if (!handle->Update(modelView)) return; m2::RectD const pixelRect = handle->GetPixelRect(modelView); @@ -92,9 +90,7 @@ void OverlayTree::Select(m2::RectD const & rect, TSelectResult & result) const ScreenBase screen = m_traits.m_modelView; ForEachInRect(rect, [&](detail::OverlayInfo const & info) { - if (info.m_handle->IsValid() && - info.m_handle->IsVisible() && - info.m_handle->GetFeatureID().IsValid()) + if (info.m_handle->IsVisible() && info.m_handle->GetFeatureID().IsValid()) { OverlayHandle::Rects shape; info.m_handle->GetPixelShape(screen, shape); diff --git a/drape/overlay_tree.hpp b/drape/overlay_tree.hpp index 78769a17fd..3c35908d0e 100644 --- a/drape/overlay_tree.hpp +++ b/drape/overlay_tree.hpp @@ -51,7 +51,7 @@ public: bool IsNeedUpdate() const; void ForceUpdate(); - void StartOverlayPlacing(ScreenBase const & screen, bool canOverlap = false); + void StartOverlayPlacing(ScreenBase const & screen); void Add(ref_ptr<OverlayHandle> handle, bool isTransparent); void EndOverlayPlacing(); @@ -62,7 +62,6 @@ private: ScreenBase const & GetModelView() const { return m_traits.m_modelView; } private: - bool m_canOverlap = false; int m_frameCounter = -1; }; diff --git a/drape/render_bucket.cpp b/drape/render_bucket.cpp index b4d0fb0dce..b980a12cd5 100644 --- a/drape/render_bucket.cpp +++ b/drape/render_bucket.cpp @@ -85,17 +85,14 @@ void RenderBucket::Render(ScreenBase const & screen) bool hasIndexMutation = false; for (drape_ptr<OverlayHandle> const & handle : m_overlay) { - if (handle->IsValid()) + if (handle->IndexesRequired() && handle->IsVisible()) { - if (handle->IndexesRequired() && handle->IsVisible()) - { - handle->GetElementIndexes(rfpIndex); - hasIndexMutation = true; - } - - if (handle->HasDynamicAttributes()) - handle->GetAttributeMutation(rfpAttrib, screen); + handle->GetElementIndexes(rfpIndex); + hasIndexMutation = true; } + + if (handle->HasDynamicAttributes()) + handle->GetAttributeMutation(rfpAttrib, screen); } m_buffer->ApplyMutation(hasIndexMutation ? rfpIndex : nullptr, rfpAttrib); |