MCPcopy Index your code
hub / github.com/processing/processing / displayDensity

Method displayDensity

core/src/processing/core/PApplet.java:1139–1151  ·  view source on GitHub ↗

( begin auto-generated from displayDensity.xml ) This function returns the number "2" if the screen is a high-density screen (called a Retina display on OS X or high-dpi on Windows and Linux) and a "1" if not. This information is useful for a program to adapt to run at double the pixel density on a

()

Source from the content-addressed store, hash-verified

1137 * @see PApplet#size(int,int)
1138 */
1139 public int displayDensity() {
1140 if (display != SPAN && (fullScreen || present)) {
1141 return displayDensity(display);
1142 }
1143 // walk through all displays, use 2 if any display is 2
1144 for (int i = 0; i < displayDevices.length; i++) {
1145 if (displayDensity(i+1) == 2) {
1146 return 2;
1147 }
1148 }
1149 // If nobody's density is 2 then everyone is 1
1150 return 1;
1151 }
1152
1153 /**
1154 * @param display the display number to check

Callers 1

pixelDensityMethod · 0.95

Calls 4

formatMethod · 0.65
getMethod · 0.65
containsMethod · 0.45
printlnMethod · 0.45

Tested by

no test coverage detected