Apply kerning to the current glyph. (#465)

Kerning value 'amount' wasn't being applied to the '_currentGlyph.Position.X' in either MoveNext() methods, only '_positionDelta.X'. Both are needed for proper positioning.
This commit is contained in:
SenpaiSharp
2018-02-07 22:00:04 +10:00
committed by Dylan Wilson
parent bcfb64fe35
commit fa3ec93ae2
@@ -187,7 +187,10 @@ namespace MonoGame.Extended.BitmapFonts
{
int amount;
if (_previousGlyph.Value.FontRegion.Kernings.TryGetValue(character, out amount))
{
_positionDelta.X += amount;
_currentGlyph.Position.X += amount;
}
}
_previousGlyph = _currentGlyph;
@@ -302,7 +305,10 @@ namespace MonoGame.Extended.BitmapFonts
{
int amount;
if (_previousGlyph.Value.FontRegion.Kernings.TryGetValue(character, out amount))
{
_positionDelta.X += amount;
_currentGlyph.Position.X += amount;
}
}
_previousGlyph = _currentGlyph;
@@ -343,4 +349,4 @@ namespace MonoGame.Extended.BitmapFonts
public Vector2 Position;
public BitmapFontRegion FontRegion;
}
}
}