Auto-Wrap Label crashes the application if it's shrunken into zero-lengt

This commit is contained in:
bancika
2021-01-09 10:05:10 +01:00
parent 5835d18a21
commit 751f6493cd
2 changed files with 10 additions and 0 deletions
@@ -112,6 +112,12 @@ public class StringUtils {
}
if (pos == -1)
pos = guess; // Split in the middle of the word
// if we couldn't find a match, expand maxWidth
if (pos <= 0) {
maxWidth++;
continue;
}
list.add(line.substring(0, pos).trim());
line = line.substring(pos).trim();