From 7eaa1da860ade7794572e1834ad51506a4697ec8 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sat, 20 Jun 2020 15:42:36 +0200 Subject: [PATCH] fixed the new MeasureString in GenericFont not returning an empty size for empty strings --- MLEM/Font/GenericFont.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MLEM/Font/GenericFont.cs b/MLEM/Font/GenericFont.cs index 994771e..37872cb 100644 --- a/MLEM/Font/GenericFont.cs +++ b/MLEM/Font/GenericFont.cs @@ -88,6 +88,8 @@ namespace MLEM.Font { /// public Vector2 MeasureString(string text) { var size = Vector2.Zero; + if (text.Length <= 0) + return size; var xOffset = 0F; foreach (var c in text) { switch (c) {