diff --git a/core/src/processing/core/PApplet.java b/core/src/processing/core/PApplet.java index d1297ec6f..4fccd1a53 100644 --- a/core/src/processing/core/PApplet.java +++ b/core/src/processing/core/PApplet.java @@ -802,6 +802,7 @@ public PSurface getSurface() { // Unlike the others above, needs to be public to support // the pixelWidth and pixelHeight fields. public int pixelDensity = 1; + boolean pixelDensityWarning = false; boolean present; @@ -1082,6 +1083,9 @@ public int displayDensity(int display) { */ public void pixelDensity(int density) { //println(density + " " + this.pixelDensity); + + + this.pixelDensityWarning = false; if (density != this.pixelDensity) { if (insideSettings("pixelDensity", density)) { if (density != 1 && density != 2) { @@ -2050,6 +2054,10 @@ public void handleDraw() { if (frameCount == 0) { setup(); + if(pixelDensityWarning){ + System.err.println("Warning: Processing now sets pixelDensity(2) by default on high-density screens. This may change how your sketch looks. To revert to the old behavior, set pixelDensity(1) in setup()."); + } + } else { // frameCount > 0, meaning an actual draw() // update the current frameRate @@ -10106,6 +10114,7 @@ static public void runSketch(final String[] args, sketch.fullScreen = fullScreen; sketch.pixelDensity = sketch.displayDensity(); + sketch.pixelDensityWarning = sketch.pixelDensity > 1; // For 3.0.1, moved this above handleSettings() so that loadImage() can be // used inside settings(). Sets a terrible precedent, but the alternative