diff --git a/graphics/overlay_element.cpp b/graphics/overlay_element.cpp index ff6d5c0b32..4bbc979e0c 100644 --- a/graphics/overlay_element.cpp +++ b/graphics/overlay_element.cpp @@ -58,10 +58,11 @@ namespace graphics return m_pivot; } - void OverlayElement::setPivot(m2::PointD const & pivot) + void OverlayElement::setPivot(m2::PointD const & pivot, bool dirtyFlag) { m_pivot = pivot; - setIsDirtyLayout(true); + if (dirtyFlag) + setIsDirtyLayout(true); } graphics::EPosition OverlayElement::position() const diff --git a/graphics/overlay_element.hpp b/graphics/overlay_element.hpp index 7f197260ad..cae4a9dc8b 100644 --- a/graphics/overlay_element.hpp +++ b/graphics/overlay_element.hpp @@ -89,7 +89,7 @@ namespace graphics virtual double priority() const; m2::PointD const & pivot() const; - virtual void setPivot(m2::PointD const & pv); + virtual void setPivot(m2::PointD const & pv, bool dirtyFlag = true); m2::PointD const point(EPosition pos) const; diff --git a/graphics/path_text_element.cpp b/graphics/path_text_element.cpp index 12f277af6c..015bd9cb33 100644 --- a/graphics/path_text_element.cpp +++ b/graphics/path_text_element.cpp @@ -77,9 +77,9 @@ namespace graphics drawTextImpl(m_glyphLayout, screen, m, false, false, desc, depth() + doffs++); } - void PathTextElement::setPivot(m2::PointD const & pivot) + void PathTextElement::setPivot(m2::PointD const & pivot, bool dirtyFlag) { - TextElement::setPivot(pivot); + TextElement::setPivot(pivot, dirtyFlag); m_glyphLayout.setPivot(pivot); } diff --git a/graphics/path_text_element.hpp b/graphics/path_text_element.hpp index ab1b47c4a5..6069959fb1 100644 --- a/graphics/path_text_element.hpp +++ b/graphics/path_text_element.hpp @@ -33,7 +33,7 @@ namespace graphics void draw(OverlayRenderer * r, math::Matrix const & m) const; - void setPivot(m2::PointD const & pivot); + void setPivot(m2::PointD const & pivot, bool dirtyFlag = true); void setTransformation(const math::Matrix & m); }; } diff --git a/graphics/straight_text_element.cpp b/graphics/straight_text_element.cpp index 09210aeef9..16a7ed5eb0 100644 --- a/graphics/straight_text_element.cpp +++ b/graphics/straight_text_element.cpp @@ -225,12 +225,12 @@ namespace graphics } } - void StraightTextElement::setPivot(m2::PointD const & pv) + void StraightTextElement::setPivot(m2::PointD const & pv, bool dirtyFlag) { m2::PointD oldPv = pivot(); m2::PointD offs = pv - oldPv; - TextElement::setPivot(pv); + TextElement::setPivot(pv, dirtyFlag); for (size_t i = 0; i < m_glyphLayouts.size(); ++i) m_glyphLayouts[i].setPivot(m_glyphLayouts[i].pivot() + offs); diff --git a/graphics/straight_text_element.hpp b/graphics/straight_text_element.hpp index 221cbd8623..52532aa64b 100644 --- a/graphics/straight_text_element.hpp +++ b/graphics/straight_text_element.hpp @@ -38,7 +38,7 @@ namespace graphics void draw(OverlayRenderer * r, math::Matrix const & m) const; - void setPivot(m2::PointD const & pv); + void setPivot(m2::PointD const & pv, bool dirtyFlag = true); void setTransformation(const math::Matrix & m); diff --git a/gui/button.cpp b/gui/button.cpp index d5e3e32fa0..87c4e6f6aa 100644 --- a/gui/button.cpp +++ b/gui/button.cpp @@ -195,10 +195,10 @@ namespace gui } } - void Button::setPivot(m2::PointD const & pv) + void Button::setPivot(m2::PointD const & pv, bool dirtyFlag) { - m_textView->setPivot(pv); - Element::setPivot(pv); + m_textView->setPivot(pv, dirtyFlag); + Element::setPivot(pv, dirtyFlag); } void Button::setFont(EState state, graphics::FontDesc const & font) diff --git a/gui/button.hpp b/gui/button.hpp index 9f404ba1cd..de0fc26eb4 100644 --- a/gui/button.hpp +++ b/gui/button.hpp @@ -67,7 +67,7 @@ namespace gui virtual m2::RectD GetBoundRect() const; void draw(graphics::OverlayRenderer * r, math::Matrix const & m) const; - void setPivot(m2::PointD const & pv); + void setPivot(m2::PointD const & pv, bool dirtyFlag = true); void purge(); void layout(); diff --git a/gui/cached_text_view.cpp b/gui/cached_text_view.cpp index 91b58e3c46..6fe37be3b2 100644 --- a/gui/cached_text_view.cpp +++ b/gui/cached_text_view.cpp @@ -143,9 +143,9 @@ namespace gui position())); } - void CachedTextView::setPivot(m2::PointD const & pv) + void CachedTextView::setPivot(m2::PointD const & pv, bool dirtyFlag) { - Element::setPivot(pv); + Element::setPivot(pv, dirtyFlag); if (m_maskedLayout) m_maskedLayout->setPivot(pivot()); diff --git a/gui/cached_text_view.hpp b/gui/cached_text_view.hpp index 57367363e7..e28b080cf2 100644 --- a/gui/cached_text_view.hpp +++ b/gui/cached_text_view.hpp @@ -53,7 +53,7 @@ namespace gui void setFont(EState state, graphics::FontDesc const & desc); - void setPivot(m2::PointD const & pv); + void setPivot(m2::PointD const & pv, bool dirtyFlag = true); //@} private: diff --git a/map/location_state.cpp b/map/location_state.cpp index 7251119442..c389477da4 100644 --- a/map/location_state.cpp +++ b/map/location_state.cpp @@ -17,6 +17,7 @@ #include "../indexer/mercator.hpp" #include "../platform/location.hpp" +#include "../platform/settings.hpp" #include "../geometry/rect2d.hpp" #include "../geometry/transformations.hpp" @@ -241,6 +242,9 @@ State::State(Params const & p) { m_locationAreaColor = p.m_locationAreaColor; m_framework = p.m_framework; + bool isBench = false; + if (Settings::Get("IsBenchmarking", isBench) && isBench) + m_modeInfo = UnknownPosition; setIsVisible(false); } @@ -454,7 +458,7 @@ void State::update() if (isVisible() && IsModeHasPosition()) { m2::PointD const pxPosition = m_framework->GetNavigator().GtoP(Position()); - setPivot(pxPosition); + setPivot(pxPosition, false); if (m_animTask) static_cast(m_animTask.get())->Update();