mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 09:12:09 +10:00
Auto-Wrap Label crashes the application if it's shrunken into zero-lengt
This commit is contained in:
@@ -3489,6 +3489,10 @@
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>IMPROVEMENT</changeType>
|
||||
<description>Improved code robustness</description>
|
||||
</org.diylc.appframework.update.Change>
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>BUG_FIX</changeType>
|
||||
<description>Auto-Wrap Label crashes the application if it's shrunken into zero-length</description>
|
||||
</org.diylc.appframework.update.Change>
|
||||
</changes>
|
||||
<url>https://github.com/bancika/diy-layout-creator/releases</url>
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user