mirror of
https://github.com/AlexMacocian/MonoGame.Extended.git
synced 2026-07-25 08:22:15 +00:00
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:
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user