From e39ee576593d09e9c26a57023dee7305741a4589 Mon Sep 17 00:00:00 2001 From: PanteraPolnocy Date: Tue, 28 Jul 2026 10:37:26 +0200 Subject: [PATCH] FIRE-36857 Horizontal scroll bar in chat window Signed-off-by: PanteraPolnocy --- indra/llrender/llfontgl.cpp | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp index 292dc6ba35..c10dd4ae1f 100644 --- a/indra/llrender/llfontgl.cpp +++ b/indra/llrender/llfontgl.cpp @@ -675,11 +675,19 @@ S32 LLFontGL::maxDrawableChars(const llwchar* wchars, F32 max_pixels, S32 max_ch } // account for glyphs that run beyond the starting point for the next glyphs - width_padding = llmax( 0.f, // always use positive padding amount - width_padding - fgi->mXAdvance, // previous padding left over after advance of current character - (F32)(fgi->mWidth + fgi->mXBearing) - fgi->mXAdvance); // difference between width of this character and advance to next character + // FIRE-36857 Horizontal scroll bar in chat window + // width_padding = llmax( 0.f, // always use positive padding amount + // width_padding - fgi->mXAdvance, // previous padding left over after advance of current character + // (F32)(fgi->mWidth + fgi->mXBearing) - fgi->mXAdvance); // difference between width of this character and advance to next character + // + // cur_x += fgi->mXAdvance; - cur_x += fgi->mXAdvance; + F32 advance = mFontFreetype->getXAdvance(fgi); + width_padding = llmax( 0.f, // always use positive padding amount + width_padding - advance, // previous padding left over after advance of current character + (F32)(fgi->mWidth + fgi->mXBearing) - advance); // difference between width of this character and advance to next character + cur_x += advance; + // // clip if current character runs past scaled_max_pixels (using width_padding) if (scaled_max_pixels < cur_x + width_padding) @@ -744,7 +752,10 @@ S32 LLFontGL::firstDrawableChar(const llwchar* wchars, F32 max_pixels, S32 text_ // other characters just use advance F32 width = (i == start) ? (F32)(fgi->mWidth + fgi->mXBearing) // use actual width for last character - : fgi->mXAdvance; // use advance for all other characters + // FIRE-36857 Horizontal scroll bar in chat window + // : fgi->mXAdvance; // use advance for all other characters + : mFontFreetype->getXAdvance(fgi); // use advance for all other characters + // if( scaled_max_pixels < (total_width + width) ) {