sojamo / controlp5

A gui library for processing.org
GNU Lesser General Public License v2.1
490 stars 142 forks source link

Textarea space character issue #105

Open takahashilabo opened 7 years ago

takahashilabo commented 7 years ago

Thank you for developing the useful Processing library.

I have same problem below. http://stackoverflow.com/questions/14744943/controlp5-textarea-space-character-issue

If the instance of Textarea is set the string including space character only in a row by setText method, Processing throws StringIndexOutOfBoundsException.

I inspect the calculateHeight method of ControlFont.java. To deal with the case, I think the 201th line of ControlFont.java should be the code below.

txt.add( myString.substring( 0 , PApplet.max( 0 , myString.length( ) - 1 ) ) );

Thanks.

sojamo commented 7 years ago

ok noted. thanks.