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
Introduces a warning message when pixelDensity defaults to 2x to match the display's pixel density. The warning prompts users to explicitly set pixelDensity in settings() to avoid the message.
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: pixelDensity() now defaults to 2x to align with your display's pixel density. To avoid this warning, please explicitly set pixelDensity() in settings().");
2059
+
}
2060
+
2053
2061
} else { // frameCount > 0, meaning an actual draw()
2054
2062
// update the current frameRate
2055
2063
@@ -10106,6 +10114,7 @@ static public void runSketch(final String[] args,
0 commit comments