diff --git a/MLEM/Formatting/Codes/ImageCode.cs b/MLEM/Formatting/Codes/ImageCode.cs index 4a6b6fd..0b51d6c 100644 --- a/MLEM/Formatting/Codes/ImageCode.cs +++ b/MLEM/Formatting/Codes/ImageCode.cs @@ -41,12 +41,6 @@ namespace MLEM.Formatting.Codes { batch.Draw(this.image.CurrentRegion, new RectangleF(pos, new Vector2(font.LineHeight * scale)), actualColor); } - /// - public override bool DrawCharacter(GameTime time, SpriteBatch batch, int codePoint, string character, Token token, int indexInToken, ref Vector2 pos, GenericFont font, ref Color color, ref float scale, float depth) { - // we don't want to draw the first (space) character (in case it is set to a missing character in FNA) - return indexInToken == 0; - } - } /// diff --git a/MLEM/Formatting/TokenizedString.cs b/MLEM/Formatting/TokenizedString.cs index 0f90d99..f1f998c 100644 --- a/MLEM/Formatting/TokenizedString.cs +++ b/MLEM/Formatting/TokenizedString.cs @@ -167,19 +167,21 @@ namespace MLEM.Formatting { var indexInToken = 0; for (var l = 0; l < token.SplitDisplayString.Length; l++) { + // only draw self at the start of the first line of the token! + if (indexInToken == 0) { + token.DrawSelf(time, batch, pos + innerOffset, drawFont, color, scale, depth); + innerOffset.X += selfWidth * scale; + } + var charIndex = 0; var line = new CodePointSource(token.SplitDisplayString[l]); while (charIndex < line.Length) { var (codePoint, length) = line.GetCodePoint(charIndex); var character = CodePointSource.ToString(codePoint); - if (indexInToken == 0) - token.DrawSelf(time, batch, pos + innerOffset, drawFont, color, scale, depth); token.DrawCharacter(time, batch, codePoint, character, indexInToken, pos + innerOffset, drawFont, drawColor, scale, depth); innerOffset.X += drawFont.MeasureString(character).X * scale; - if (indexInToken == 0) - innerOffset.X += selfWidth * scale; charIndex += length; indexInToken++; }