avoid another "Zero length string passed to TextLayout constructor" error, other notes

This commit is contained in:
Ben Fry
2015-11-05 10:05:51 -05:00
parent 14e050c8d2
commit 9756ee1089
4 changed files with 22 additions and 1 deletions

View File

@@ -1942,6 +1942,10 @@ public class PGraphicsJava2D extends PGraphics {
if (textFont == null) {
defaultFontOrDeath("textWidth");
}
// Avoid "Zero length string passed to TextLayout constructor" error
if (start == stop) {
return 0;
}
Font font = (Font) textFont.getNative();
// System.out.println(font);