Skip to content

Commit

Permalink
Fix java.lang.StringIndexOutOfBoundsException in TextArea.calculateTe…
Browse files Browse the repository at this point in the history
…xt when whiteSpace:nowrap is used
  • Loading branch information
hvbtup committed Jun 23, 2021
1 parent 9035efe commit be6294f
Showing 1 changed file with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -335,16 +335,18 @@ private void addWordIntoTextArea( TextArea textArea, Word word )
wordVestige = null;
insertFirstExceedWord = false;
}
if ( isNewLine && context.isEnableWordbreak( ))
if ( isNewLine && textArea.isEmpty( ) )
{
doWordBreak( word.getValue( ), textArea );
}
else if ( isNewLine && textArea.isEmpty( ) )
{
// If width of a word is larger than the max line width, add
// it into the line directly.
addWord( textArea, textLength, wordWidth );

if ( context.isEnableWordbreak( ) )
{
doWordBreak( word.getValue( ), textArea );
}
else
{
// If width of a word is larger than the max line width, add
// it into the line directly.
addWord( textArea, textLength, wordWidth );
}
}
else
{
Expand Down

0 comments on commit be6294f

Please sign in to comment.