From 49146b3bbea0fc169702931756500d7ae016b806 Mon Sep 17 00:00:00 2001 From: rachytski Date: Thu, 22 Sep 2011 17:39:01 +0300 Subject: [PATCH] using m_offset to save original offsets during transformation. --- qt/qt_window_handle.hpp | 26 -------------------------- yg/straight_text_element.cpp | 12 ++++++------ yg/straight_text_element.hpp | 1 + 3 files changed, 7 insertions(+), 32 deletions(-) delete mode 100644 qt/qt_window_handle.hpp diff --git a/qt/qt_window_handle.hpp b/qt/qt_window_handle.hpp deleted file mode 100644 index 7ba5d29e1c..0000000000 --- a/qt/qt_window_handle.hpp +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once - -#include "../base/assert.hpp" - -#include "../map/window_handle.hpp" - -#include - -namespace qt -{ - class WindowHandle : public ::WindowHandle - { - QWidget * m_pWnd; - - public: - - WindowHandle(QWidget * p) : m_pWnd(p) {} - - void invalidateImpl() - { - ASSERT ( m_pWnd != 0, () ); - m_pWnd->setUpdatesEnabled(true); - m_pWnd->update(); - } - }; -} diff --git a/yg/straight_text_element.cpp b/yg/straight_text_element.cpp index c446c02e3c..1325b00454 100644 --- a/yg/straight_text_element.cpp +++ b/yg/straight_text_element.cpp @@ -135,7 +135,10 @@ namespace yg m_glyphLayouts[i].setPivot(m_glyphLayouts[i].pivot() + m2::PointD(0, allElemHeight / 2)); for (unsigned i = 0; i < res.size(); ++i) - m_glyphLayouts[i].setPivot(m_glyphLayouts[i].pivot() + pivot()); + { + m_offsets.push_back(m_glyphLayouts[i].pivot()); + m_glyphLayouts[i].setPivot(m_offsets[i] + pivot()); + } } StraightTextElement::Params::Params() @@ -150,16 +153,13 @@ namespace yg : TextElement(src), m_glyphLayouts(src.m_glyphLayouts) { - static vector offsets; - offsets.clear(); - for (unsigned i = 0; i < m_glyphLayouts.size(); ++i) - offsets.push_back(m2::PointD(m_glyphLayouts[i].pivot() - pivot())); + m_offsets = src.m_offsets; setPivot(pivot() * m); for (unsigned i = 0; i < m_glyphLayouts.size(); ++i) - m_glyphLayouts[i].setPivot(pivot() + offsets[i]); + m_glyphLayouts[i].setPivot(pivot() + m_offsets[i]); } vector const & StraightTextElement::boundRects() const diff --git a/yg/straight_text_element.hpp b/yg/straight_text_element.hpp index 667188e89b..352b457820 100644 --- a/yg/straight_text_element.hpp +++ b/yg/straight_text_element.hpp @@ -10,6 +10,7 @@ namespace yg /// glyph layout of the text parts. vector m_glyphLayouts; + vector m_offsets; public: