1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-22 20:58:34 +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]); total.Append(text[i]);
} }
if (this.MeasureString(total).X * scale + ellipsisWidth >= width) if (this.MeasureString(total).X * scale + ellipsisWidth >= width) {
return total.Remove(fromBack ? 0 : total.Length - 1, 1).Append(ellipsis).ToString(); 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(); return total.ToString();
} }