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:
@@ -3490,6 +3490,10 @@
|
|||||||
<changeType>IMPROVEMENT</changeType>
|
<changeType>IMPROVEMENT</changeType>
|
||||||
<description>Improved code robustness</description>
|
<description>Improved code robustness</description>
|
||||||
</org.diylc.appframework.update.Change>
|
</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>
|
</changes>
|
||||||
<url>https://github.com/bancika/diy-layout-creator/releases</url>
|
<url>https://github.com/bancika/diy-layout-creator/releases</url>
|
||||||
</org.diylc.appframework.update.Version>
|
</org.diylc.appframework.update.Version>
|
||||||
|
|||||||
@@ -113,6 +113,12 @@ public class StringUtils {
|
|||||||
if (pos == -1)
|
if (pos == -1)
|
||||||
pos = guess; // Split in the middle of the word
|
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());
|
list.add(line.substring(0, pos).trim());
|
||||||
line = line.substring(pos).trim();
|
line = line.substring(pos).trim();
|
||||||
len = line.length();
|
len = line.length();
|
||||||
|
|||||||
Reference in New Issue
Block a user