From 67e759e80b755e83e80507b1b6ac31ee7e82bf0b Mon Sep 17 00:00:00 2001 From: Jonathan Marshall Date: Sun, 4 May 2014 12:00:58 +1200 Subject: [PATCH] [gui] fix not being shown once unfocused/refocused --- xbmc/guilib/GUITextLayout.cpp | 7 +++++-- xbmc/guilib/GUITextLayout.h | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/xbmc/guilib/GUITextLayout.cpp b/xbmc/guilib/GUITextLayout.cpp index 9968289..4782aa0 100644 --- a/xbmc/guilib/GUITextLayout.cpp +++ b/xbmc/guilib/GUITextLayout.cpp @@ -52,6 +52,7 @@ CGUITextLayout::CGUITextLayout(CGUIFont *font, bool wrap, float fHeight, CGUIFon m_maxHeight = fHeight; m_textWidth = 0; m_textHeight = 0; + m_lastUpdateW = false; } void CGUITextLayout::SetWrap(bool bWrap) @@ -217,10 +218,11 @@ void CGUITextLayout::RenderOutline(float x, float y, color_t color, color_t outl bool CGUITextLayout::Update(const CStdString &text, float maxWidth, bool forceUpdate /*= false*/, bool forceLTRReadingOrder /*= false*/) { - if (text == m_lastUtf8Text && !forceUpdate) + if (text == m_lastUtf8Text && !forceUpdate && !m_lastUpdateW) return false; m_lastUtf8Text = text; + m_lastUpdateW = false; CStdStringW utf16; utf8ToW(text, utf16); UpdateCommon(utf16, maxWidth, forceLTRReadingOrder); @@ -229,10 +231,11 @@ bool CGUITextLayout::Update(const CStdString &text, float maxWidth, bool forceUp bool CGUITextLayout::UpdateW(const CStdStringW &text, float maxWidth /*= 0*/, bool forceUpdate /*= false*/, bool forceLTRReadingOrder /*= false*/) { - if (text == m_lastText && !forceUpdate) + if (text == m_lastText && !forceUpdate && m_lastUpdateW) return false; m_lastText = text; + m_lastUpdateW = true; UpdateCommon(text, maxWidth, forceLTRReadingOrder); return true; } diff --git a/xbmc/guilib/GUITextLayout.h b/xbmc/guilib/GUITextLayout.h index 2c98e85..a855663 100644 --- a/xbmc/guilib/GUITextLayout.h +++ b/xbmc/guilib/GUITextLayout.h @@ -134,6 +134,7 @@ protected: std::string m_lastUtf8Text; CStdStringW m_lastText; + bool m_lastUpdateW; ///< true if the last string we updated was the wstring version float m_textWidth; float m_textHeight; private: -- 2.7.4