disallow textSize() <= 0 (fixes #3110)

This commit is contained in:
Ben Fry
2015-02-25 09:50:58 -05:00
parent 6d930c0d5b
commit 54970ef51c
2 changed files with 8 additions and 0 deletions
+6
View File
@@ -4131,6 +4131,12 @@ public class PGraphics extends PImage implements PConstants {
* @see PGraphics#textFont(PFont)
*/
public void textSize(float size) {
// https://github.com/processing/processing/issues/3110
if (size <= 0) {
System.err.println("textSize(" + size + ") ignored: " +
"the text size must be larger than zero");
return;
}
if (textFont == null) {
defaultFontOrDeath("textSize", size);
}
+2
View File
@@ -8,6 +8,8 @@ X mostly getting away from this
X bezierSegment() function to do equal-length segments
X https://github.com/processing/processing/issues/2919
X handled instead as an example
X add warning message when a negative textSize() is used
X https://github.com/processing/processing/issues/3110
_ dragging sketch window hides it
_ https://github.com/processing/processing/issues/3092