diff --git a/data/minsk-pass.mwm b/data/minsk-pass.mwm index d446f11667..480ad825e8 100644 Binary files a/data/minsk-pass.mwm and b/data/minsk-pass.mwm differ diff --git a/indexer/displacement_manager.hpp b/indexer/displacement_manager.hpp index 5dd1e5c3ce..55d8ef25c6 100644 --- a/indexer/displacement_manager.hpp +++ b/indexer/displacement_manager.hpp @@ -18,12 +18,11 @@ namespace { -double constexpr kPOIDisplacementRadiusPixels = 16.; +double constexpr kPOIDisplacementRadiusPixels = 60.; -// Rendering dramatically affected by a screen resolution. So I will use high resolution to cover -// case when we have a lot of free space on the screen. -size_t constexpr kMaxScreenSizeXPixels = 2560; -size_t constexpr kMaxScreenSizeYPixels = 1440; +// 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. +double constexpr kPOIDisplacementRadiusMultiplier = kPOIDisplacementRadiusPixels * 180. / 512.; } // namespace namespace covering @@ -117,7 +116,9 @@ public: { m4::Tree acceptedNodes; - sort(m_storage.begin(), m_storage.end()); + // Sort in priority descend mode. + sort(m_storage.begin(), m_storage.end(), greater()); + for (auto const & node : m_storage) { uint32_t scale = node.m_minScale; @@ -194,7 +195,7 @@ private: m_priority = (static_cast(d) << 8) | rank; } - bool operator<(DisplaceableNode const & rhs) const { return m_priority < rhs.m_priority; } + bool operator>(DisplaceableNode const & rhs) const { return m_priority > rhs.m_priority; } m2::RectD const GetLimitRect() const { return m2::RectD(m_center, m_center); } }; @@ -207,15 +208,9 @@ private: float CalculateDeltaForZoom(int32_t zoom) const { - double const worldSizeDivisor = 1 << zoom; - // Mercator SizeX and SizeY is equal - double const rectSize = (MercatorBounds::maxX - MercatorBounds::minX) / worldSizeDivisor; - - ScreenBase geometryConvertor; - geometryConvertor.OnSize(0, 0, kMaxScreenSizeXPixels, kMaxScreenSizeYPixels); - geometryConvertor.SetFromRect(m2::AnyRectD(m2::RectD(0, 0, rectSize, rectSize))); - - return kPOIDisplacementRadiusPixels * geometryConvertor.GetScale(); + // zoom - 1 is similar to drape. + double const worldSizeDivisor = 1 << (zoom - 1); + return kPOIDisplacementRadiusMultiplier / worldSizeDivisor; } void AddNodeToSorter(DisplaceableNode const & node, uint32_t scale)