mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
disallow textSize() <= 0 (fixes #3110)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user