1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-12-25 17:59:24 +01:00

actually append ellipsis to the right end

This commit is contained in:
Ellpeck 2020-04-11 15:47:33 +02:00
parent e4ba2bc38f
commit bc61e36ac5

View file

@ -59,8 +59,13 @@ namespace MLEM.Font {
total.Append(text[i]);
}
if (this.MeasureString(total).X * scale + ellipsisWidth >= width)
return total.Remove(fromBack ? 0 : total.Length - 1, 1).Append(ellipsis).ToString();
if (this.MeasureString(total).X * scale + ellipsisWidth >= width) {
if (fromBack) {
return total.Remove(0, 1).Insert(0, ellipsis).ToString();
} else {
return total.Remove(total.Length - 1, 1).Append(ellipsis).ToString();
}
}
}
return total.ToString();
}