diff --git a/yg/path_text_element.cpp b/yg/path_text_element.cpp index 28ffb7441e..46033aec1c 100644 --- a/yg/path_text_element.cpp +++ b/yg/path_text_element.cpp @@ -77,10 +77,10 @@ namespace yg drawTextImpl(m_glyphLayout, screen, m, false, desc, yg::maxDepth); } - void PathTextElement::offset(m2::PointD const & offs) + void PathTextElement::setPivot(m2::PointD const & pivot) { - TextElement::offset(offs); - m_glyphLayout.setPivot(pivot()); + TextElement::setPivot(pivot); + m_glyphLayout.setPivot(pivot); } int PathTextElement::visualRank() const diff --git a/yg/path_text_element.hpp b/yg/path_text_element.hpp index 11ac90e66d..32361d6d22 100644 --- a/yg/path_text_element.hpp +++ b/yg/path_text_element.hpp @@ -29,7 +29,7 @@ namespace yg int visualRank() const; - void offset(m2::PointD const & offs); + void setPivot(m2::PointD const & pivot); OverlayElement * clone(math::Matrix const & m) const; }; diff --git a/yg/straight_text_element.cpp b/yg/straight_text_element.cpp index c1e95905ea..43e501baa5 100644 --- a/yg/straight_text_element.cpp +++ b/yg/straight_text_element.cpp @@ -282,9 +282,12 @@ namespace yg } } - void StraightTextElement::offset(m2::PointD const & offs) + void StraightTextElement::setPivot(m2::PointD const & pv) { - TextElement::offset(offs); + m2::PointD oldPv = pivot(); + m2::PointD offs = pv - oldPv; + + TextElement::setPivot(pv); for (unsigned i = 0; i < m_glyphLayouts.size(); ++i) m_glyphLayouts[i].setPivot(m_glyphLayouts[i].pivot() + offs); diff --git a/yg/straight_text_element.hpp b/yg/straight_text_element.hpp index 40774437f3..09e96c993a 100644 --- a/yg/straight_text_element.hpp +++ b/yg/straight_text_element.hpp @@ -35,7 +35,7 @@ namespace yg int visualRank() const; - void offset(m2::PointD const & offs); + void setPivot(m2::PointD const & pv); OverlayElement * clone(math::Matrix const & m) const; };