Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLev Dragunov <l.dragunov@corp.mail.ru>2016-03-18 16:39:57 +0300
committerSergey Yershov <yershov@corp.mail.ru>2016-03-23 16:57:00 +0300
commit580697874fe4605102c553fee6e4b2017dff3f03 (patch)
treed7e2c1973ce690cf3b502c52f657e28f2d2f8caa /indexer/displacement_manager.hpp
parentb38da9c7c899c8a141eb53735d874c34f4a6666b (diff)
Displacement sync with dynamic.
Diffstat (limited to 'indexer/displacement_manager.hpp')
-rw-r--r--indexer/displacement_manager.hpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/indexer/displacement_manager.hpp b/indexer/displacement_manager.hpp
index 55d8ef25c6..b2e20bf5ae 100644
--- a/indexer/displacement_manager.hpp
+++ b/indexer/displacement_manager.hpp
@@ -18,7 +18,7 @@
namespace
{
-double constexpr kPOIDisplacementRadiusPixels = 60.;
+double constexpr kPOIDisplacementRadiusPixels = 80.;
// Displacement radius in pixels * half of the world in degrees / meaned graphics tile size.
// So average displacement radius will be: this / tiles in row count.
@@ -159,6 +159,7 @@ private:
struct DisplaceableNode
{
uint32_t m_index;
+ FeatureID m_fID;
m2::PointD m_center;
vector<int64_t> m_cells;
@@ -171,7 +172,7 @@ private:
template <class TFeature>
DisplaceableNode(vector<int64_t> const & cells, TFeature const & ft, uint32_t index,
int zoomLevel)
- : m_index(index), m_center(ft.GetCenter()), m_cells(cells), m_minScale(zoomLevel)
+ : m_index(index), m_fID(ft.GetID()), m_center(ft.GetCenter()), m_cells(cells), m_minScale(zoomLevel)
{
feature::TypesHolder const types(ft);
auto scaleRange = feature::GetDrawableScaleRange(types);
@@ -195,7 +196,13 @@ private:
m_priority = (static_cast<uint32_t>(d) << 8) | rank;
}
- bool operator>(DisplaceableNode const & rhs) const { return m_priority > rhs.m_priority; }
+ // Same to dynamic displacement behaviour.
+ bool operator>(DisplaceableNode const & rhs) const
+ {
+ if (m_priority > rhs.m_priority)
+ return true;
+ return (m_priority == rhs.m_priority && m_fID < rhs.m_fID);
+ }
m2::RectD const GetLimitRect() const { return m2::RectD(m_center, m_center); }
};