From eafee92476bed94944731e95043c6acae8182fb7 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Sun, 22 Sep 2024 18:08:22 +0100 Subject: [PATCH] Fix 3d4b98845a: TC_FORCED no longer working. (#12961) Since initial colour is no longer passed to the text layout, TC_FORCED flag is not seen by the layouter, so it had no effect. Instead, check for TC_FORCED when drawing and avoid using the string's colours if set. --- src/gfx.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gfx.cpp b/src/gfx.cpp index d97e343b23..f6c3ceb51a 100644 --- a/src/gfx.cpp +++ b/src/gfx.cpp @@ -590,7 +590,7 @@ static int DrawLayoutLine(const ParagraphLayouter::Line &line, int y, int left, FontCache *fc = f->fc; TextColour colour = f->colour; - if (colour == TC_INVALID) colour = default_colour; + if (colour == TC_INVALID || HasFlag(default_colour, TC_FORCED)) colour = default_colour; colour_has_shadow = (colour & TC_NO_SHADE) == 0 && colour != TC_BLACK; SetColourRemap(do_shadow ? TC_BLACK : colour); // the last run also sets the colour for the truncation dots if (do_shadow && (!fc->GetDrawGlyphShadow() || !colour_has_shadow)) continue;