Skip to content

Commit

Permalink
Fixed text scroll color issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Pyrdacor committed Feb 1, 2023
1 parent 6d60320 commit 8748388
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Ambermoon.Renderer.OpenGL/RenderText.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,15 @@ public IReadOnlyList<TextColor> GetTextColorPerLine(IText text)
}
else if (b >= (byte)SpecialGlyph.FirstColor)
{
color = (TextColor)(b - SpecialGlyph.FirstColor);
lineColors.Add(color);
lineColors.Add((TextColor)(b - SpecialGlyph.FirstColor));
break;
}
}

// Use the last color specification in line if any for following lines
var lastColorSpec = line.LastOrDefault(b => b >= (byte)SpecialGlyph.FirstColor);
if (lastColorSpec != 0)
color = (TextColor)(lastColorSpec - SpecialGlyph.FirstColor);
}

return lineColors.AsReadOnly();
Expand Down
Binary file modified versions.dat
Binary file not shown.

0 comments on commit 8748388

Please sign in to comment.