1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-05-23 09:03:38 +02:00

fixed DrawString in generic font ignoring text scale for alignment

This commit is contained in:
Ell 2021-03-12 20:47:57 +01:00
parent 0ddb4afc3f
commit 37609ade76

View file

@ -83,13 +83,13 @@ namespace MLEM.Font {
switch (align) {
case TextAlign.Center:
case TextAlign.CenterBothAxes:
var (w, h) = this.MeasureString(text);
var (w, h) = this.MeasureString(text) * scale;
position.X -= w / 2;
if (align == TextAlign.CenterBothAxes)
position.Y -= h / 2;
break;
case TextAlign.Right:
position.X -= this.MeasureString(text).X;
position.X -= this.MeasureString(text).X * scale.X;
break;
}
this.DrawString(batch, text, position, color, rotation, origin, scale, effects, layerDepth);