aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCastagnaIT <gottardo.stefano.83@gmail.com>2024-05-08 13:19:54 +0200
committerCastagnaIT <gottardo.stefano.83@gmail.com>2024-05-08 13:22:09 +0200
commit174a4c5810a62c34471893220692f1cb55d465a0 (patch)
tree59f837a27c897dafc3619cb3071ee02f0aca8849
parent24f73e21d67482f80cc2e350e29b77a1937c02f1 (diff)
downloadxbmc-174a4c5810a62c34471893220692f1cb55d465a0.tar.xz
[GUIFontTTF] Dont reset calculated width with tabs
-rw-r--r--xbmc/guilib/GUIFontTTF.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/xbmc/guilib/GUIFontTTF.cpp b/xbmc/guilib/GUIFontTTF.cpp
index 8da0252861..f9f0eec2a3 100644
--- a/xbmc/guilib/GUIFontTTF.cpp
+++ b/xbmc/guilib/GUIFontTTF.cpp
@@ -512,11 +512,11 @@ void CGUIFontTTF::DrawTextInternal(CGraphicContext& context,
if (!c)
continue;
- float nextWidth;
+ float nextWidth = textWidth;
if ((ch & 0xffff) == static_cast<character_t>('\t'))
- nextWidth = GetTabSpaceLength();
+ nextWidth += GetTabSpaceLength();
else
- nextWidth = textWidth + c->m_advance;
+ nextWidth += c->m_advance;
if (maxPixelWidth > 0 && nextWidth > maxPixelWidth)
{
@@ -540,11 +540,11 @@ void CGUIFontTTF::DrawTextInternal(CGraphicContext& context,
if (!c)
continue;
- float nextWidth;
+ float nextWidth = textWidth;
if ((ch & 0xffff) == static_cast<character_t>('\t'))
- nextWidth = GetTabSpaceLength();
+ nextWidth += GetTabSpaceLength();
else
- nextWidth = textWidth + c->m_advance;
+ nextWidth += c->m_advance;
if (maxPixelWidth > 0 && nextWidth > maxPixelWidth)
break;