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:
parent
e4ba2bc38f
commit
bc61e36ac5
1 changed files with 7 additions and 2 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue