diff options
author | jmarshallnz <jmarshallnz@svn> | 2010-02-21 05:57:28 +0000 |
---|---|---|
committer | jmarshallnz <jmarshallnz@svn> | 2010-02-21 05:57:28 +0000 |
commit | e941ce7b4905894e005175f9118de69503944cb3 (patch) | |
tree | bd22e877196245f4a1741b3dd02761d212c56409 /guilib | |
parent | 2103402b7dd67f694ba34d6fdf686c6c9bfd43b1 (diff) |
fixed: Make sure we pass XBFONT_CENTER_Y to GUITextLayout::Render() as if an <angle> is being applied we need the correct Y coord.
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@28018 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'guilib')
-rw-r--r-- | guilib/GUILabel.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/guilib/GUILabel.cpp b/guilib/GUILabel.cpp index ef23282a76..0c82269df8 100644 --- a/guilib/GUILabel.cpp +++ b/guilib/GUILabel.cpp @@ -79,6 +79,7 @@ void CGUILabel::Render() else { float posX = m_renderRect.x1; + float posY = m_renderRect.y1; uint32_t align = 0; if (!overFlows) { // hack for right and centered multiline text, as GUITextLayout::Render() treats posX as the right hand @@ -89,11 +90,13 @@ void CGUILabel::Render() posX += m_renderRect.Width(); else if (m_label.align & XBFONT_CENTER_X) posX += m_renderRect.Width() * 0.5f; - align = m_label.align & ~XBFONT_CENTER_Y; // ignore vertical alignment + if (m_label.align & XBFONT_CENTER_Y) // need to pass a centered Y so that <angle> will rotate around the correct point. + posY += m_renderRect.Height() * 0.5f; + align = m_label.align; } else align |= XBFONT_TRUNCATED; - m_textLayout.Render(posX, m_renderRect.y1, m_label.angle, color, m_label.shadowColor, align, m_renderRect.Width(), renderSolid); + m_textLayout.Render(posX, posY, m_label.angle, color, m_label.shadowColor, align, m_renderRect.Width(), renderSolid); } } |