mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-26 06:28:35 +01:00
fixed DrawString in generic font ignoring text scale for alignment
This commit is contained in:
parent
0ddb4afc3f
commit
37609ade76
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue