From 37609ade76eaacfbace800c3ed5e6997f43c498e Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Fri, 12 Mar 2021 20:47:57 +0100 Subject: [PATCH] fixed DrawString in generic font ignoring text scale for alignment --- MLEM/Font/GenericFont.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MLEM/Font/GenericFont.cs b/MLEM/Font/GenericFont.cs index 0a8a40a..85cda24 100644 --- a/MLEM/Font/GenericFont.cs +++ b/MLEM/Font/GenericFont.cs @@ -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);