| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 741b0de commit 9e08b98
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1120,6 +1120,7 @@ public int displayDensity() { | |||
| 1120 | 1120 | return 1; | |
| 1121 | 1121 | } | |
| 1122 | 1122 | } | |
| 1123 | + // If nobody's density is 1 (or != 2, to be exact) then everyone is 2 | ||
| 1123 | 1124 | return 2; | |
| 1124 | 1125 | } | |
| 1125 | 1126 | return displayDensity(display); | |
@@ -1153,7 +1154,7 @@ static public int displayDensity(int display) { | |||
| 1153 | 1154 | System.err.println("Only one display is currently known, use displayDensity(1)."); | |
| 1154 | 1155 | } else { | |
| 1155 | 1156 | System.err.format("Your displays are numbered %d through %d, " + | |
| 1156 | - "pass one of those numbers to displayDensity()", 1, devices.length); | ||
| 1157 | + "pass one of those numbers to displayDensity()%n", 1, devices.length); | ||
| 1157 | 1158 | } | |
| 1158 | 1159 | throw new RuntimeException("Display " + display + " does not exist."); | |
| 1159 | 1160 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -329,6 +329,11 @@ make sure that it uses numbers (or displayWidth/Height), copy into settings | |||
| 329 | 329 | String[] pixelDensityContents = matchMethod("pixelDensity", searchArea); | |
| 330 | 330 | if (pixelDensityContents != null) { | |
| 331 | 331 | extraStatements.append(pixelDensityContents[0]); | |
| 332 | + } else { | ||
| 333 | + pixelDensityContents = matchDensityMess(searchArea); | ||
| 334 | + if (pixelDensityContents != null) { | ||
| 335 | + extraStatements.append(pixelDensityContents[0]); | ||
| 336 | + } | ||
| 332 | 337 | } | |
| 333 | 338 | ||
| 334 | 339 | String[] sizeContents = matchMethod("size", searchArea); | |
@@ -433,6 +438,13 @@ static protected String[] matchMethod(String methodName, String searchArea) { | |||
| 433 | 438 | } | |
| 434 | 439 | ||
| 435 | 440 | ||
| 441 | + static protected String[] matchDensityMess(String searchArea) { | ||
| 442 | + final String regexp = | ||
| 443 | + "(?:^|\\s|;)pixelDensity\\s*\\(\\s*displayDensity\\s*\\([^\\)]*\\)\\s*\\)\\s*\\;"; | ||
| 444 | + return PApplet.match(searchArea, regexp); | ||
| 445 | + } | ||
| 446 | + | ||
| 447 | + | ||
| 436 | 448 | /** | |
| 437 | 449 | * Replace all commented portions of a given String as spaces. | |
| 438 | 450 | * Utility function used here and in the preprocessor. | |
| Back | FazBrowse Home | New Git URL |
0 commit comments