mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-22 12:58:33 +01:00
fixed a splitstring crash with specific string lengths and font sizes
This commit is contained in:
parent
af98526d47
commit
e2f9a8ff5d
1 changed files with 4 additions and 2 deletions
|
@ -37,8 +37,10 @@ namespace MLEM.Extensions {
|
|||
curr.Append(word).Append(' ');
|
||||
if (widthFunc(curr) * scale >= width) {
|
||||
var len = curr.Length - word.Length - 1;
|
||||
total.Append(curr.ToString(0, len - 1)).Append('\n');
|
||||
curr.Remove(0, len);
|
||||
if (len > 0) {
|
||||
total.Append(curr.ToString(0, len - 1)).Append('\n');
|
||||
curr.Remove(0, len);
|
||||
}
|
||||
}
|
||||
}
|
||||
total.Append(curr.ToString(0, curr.Length - 1)).Append('\n');
|
||||
|
|
Loading…
Reference in a new issue