diff --git a/base/buffer_vector.hpp b/base/buffer_vector.hpp index 6f4d1b8818..035a412f55 100644 --- a/base/buffer_vector.hpp +++ b/base/buffer_vector.hpp @@ -28,6 +28,11 @@ public: resize(n, c); } + explicit buffer_vector(initializer_list const & initList) : m_size(0) + { + assign(initList.begin(), initList.end()); + } + template explicit buffer_vector(IterT beg, IterT end) : m_size(0) { diff --git a/base/matrix.hpp b/base/matrix.hpp index f8322187f6..2b05b91247 100644 --- a/base/matrix.hpp +++ b/base/matrix.hpp @@ -3,6 +3,7 @@ #include "math.hpp" #include "../std/iomanip.hpp" +#include "../std/initializer_list.hpp" namespace math @@ -26,6 +27,12 @@ namespace math copy(data, data + Rows * Cols, m_data); } + Matrix(initializer_list initList) + { + ASSERT(initList.size() == Rows * Cols, ()); + copy(initList.begin(), initList.end(), m_data); + } + template Matrix const & operator=(Matrix const & src) { diff --git a/drape/color.hpp b/drape/color.hpp index 44a0e4c743..2507c13a39 100644 --- a/drape/color.hpp +++ b/drape/color.hpp @@ -17,9 +17,11 @@ struct Color bool operator< (Color const & other) const { return m_rgba < other.m_rgba; } - static Color Black() { return Color(0, 0, 0, 255); } - static Color White() { return Color(255, 255, 255, 255); } - static Color Red() { return Color(255, 0, 0, 255); } + static Color Black() { return Color(0, 0, 0, 255); } + static Color White() { return Color(255, 255, 255, 255); } + static Color Red() { return Color(255, 0, 0, 255); } + static Color Transparent() { return Color(0, 0, 0, 0); } + static Color RoadNumberOutline() { return Color(150, 75, 0, 255); } private: uint32_t m_rgba; diff --git a/drape/overlay_handle.cpp b/drape/overlay_handle.cpp index d14a8e6125..ee63b58086 100644 --- a/drape/overlay_handle.cpp +++ b/drape/overlay_handle.cpp @@ -44,7 +44,7 @@ void OverlayHandle::SetIsVisible(bool isVisible) m_isVisible = isVisible; } -bool OverlayHandle::IsIntersect(ScreenBase const & screen, const OverlayHandle & h) const +bool OverlayHandle::IsIntersect(ScreenBase const & screen, OverlayHandle const & h) const { Rects ar1; Rects ar2; diff --git a/drape/overlay_tree.cpp b/drape/overlay_tree.cpp index d9e3367912..478f225463 100644 --- a/drape/overlay_tree.cpp +++ b/drape/overlay_tree.cpp @@ -21,8 +21,13 @@ void OverlayTree::Add(RefPointer handle) if (!handle->IsValid()) return; - + m2::RectD const pixelRect = handle->GetPixelRect(modelView); + if (!m_traits.m_modelView.PixelRect().IsIntersect(pixelRect)) + { + handle->SetIsVisible(false); + return; + } typedef buffer_vector, 8> OverlayContainerT; OverlayContainerT elements; diff --git a/drape/sdf_image.cpp b/drape/sdf_image.cpp index 28aa6409a7..76f3ea8978 100644 --- a/drape/sdf_image.cpp +++ b/drape/sdf_image.cpp @@ -171,7 +171,7 @@ void SdfImage::GenerateSDF(float sc) outside.Minus(inside); outside.Distquant(); - //outside.Invert(); + outside.Invert(); *this = outside.Bilinear(sc); }