Merge pull request #4043 from JakubValtar/fix-text-area-aioobe

Fix occasional exception while editing text
This commit is contained in:
Ben Fry
2015-10-22 11:31:49 -04:00
@@ -1343,7 +1343,8 @@ public class JEditTextArea extends JComponent
int wordStart = 0;
int wordEnd = lineText.length();
char ch = lineText.charAt(Math.max(0,offset - 1));
int charPos = PApplet.constrain(offset - 1, 0, lineText.length() - 1);
char ch = lineText.charAt(charPos);
CharacterKinds thisWord = CharacterKind(ch,noWordSep);