diff --git a/geometry/rect2d.hpp b/geometry/rect2d.hpp index 3f94f94207..0e4f5e09f2 100644 --- a/geometry/rect2d.hpp +++ b/geometry/rect2d.hpp @@ -82,6 +82,11 @@ namespace m2 m_maxX = m_maxY = impl::min_max_value().get_max(); } + bool IsValid() const + { + return (m_minX <= m_maxX && m_minY <= m_maxY); + } + void Add(m2::Point const & p) { m_minX = min(p.x, m_minX); diff --git a/yg/clipper.cpp b/yg/clipper.cpp index 67e861de14..40a2de500d 100644 --- a/yg/clipper.cpp +++ b/yg/clipper.cpp @@ -84,6 +84,7 @@ namespace yg if (renderQueue()) return; + ASSERT ( m_clipRect.IsValid(), (m_clipRect) ); OGLCHECK(glScissor(m_clipRect.minX(), m_clipRect.minY(), m_clipRect.SizeX(), m_clipRect.SizeY())); }