You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: core/src/processing/core/PApplet.java
+9Lines changed: 9 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -802,6 +802,7 @@ public PSurface getSurface() {
802
802
// Unlike the others above, needs to be public to support
803
803
// the pixelWidth and pixelHeight fields.
804
804
public int pixelDensity = 1;
805
+
boolean pixelDensityWarning = false;
805
806
806
807
boolean present;
807
808
@@ -1082,6 +1083,9 @@ public int displayDensity(int display) {
1082
1083
*/
1083
1084
public void pixelDensity(int density) {
1084
1085
//println(density + " " + this.pixelDensity);
1086
+
1087
+
1088
+
this.pixelDensityWarning = false;
1085
1089
if (density != this.pixelDensity) {
1086
1090
if (insideSettings("pixelDensity", density)) {
1087
1091
if (density != 1 && density != 2) {
@@ -2050,6 +2054,10 @@ public void handleDraw() {
2050
2054
if (frameCount == 0) {
2051
2055
setup();
2052
2056
2057
+
if(pixelDensityWarning){
2058
+
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().");
2059
+
}
2060
+
2053
2061
} else { // frameCount > 0, meaning an actual draw()
2054
2062
// update the current frameRate
2055
2063
@@ -10108,6 +10116,7 @@ static public void runSketch(final String[] args,
0 commit comments