1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-26 06:28:35 +01:00

fixed the new MeasureString in GenericFont not returning an empty size for empty strings

This commit is contained in:
Ellpeck 2020-06-20 15:42:36 +02:00
parent 64b9246aa5
commit 7eaa1da860

View file

@ -88,6 +88,8 @@ namespace MLEM.Font {
///<inheritdoc cref="SpriteFont.MeasureString(string)"/> ///<inheritdoc cref="SpriteFont.MeasureString(string)"/>
public Vector2 MeasureString(string text) { public Vector2 MeasureString(string text) {
var size = Vector2.Zero; var size = Vector2.Zero;
if (text.Length <= 0)
return size;
var xOffset = 0F; var xOffset = 0F;
foreach (var c in text) { foreach (var c in text) {
switch (c) { switch (c) {