Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions core/src/processing/core/PApplet.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
Loading