| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -309,20 +309,25 @@ make sure that it uses numbers (or displayWidth/Height), copy into settings | |||
| 309 | 309 | searchArea = sb.toString(); | |
| 310 | 310 | } | |
| 311 | 311 | ||
| 312 | + StringList extraStatements = new StringList(); | ||
| 313 | + | ||
| 312 | 314 | // First look for noSmooth() or smooth(N) so we can hoist it into settings. | |
| 313 | - String smoothStatement = null; | ||
| 314 | 315 | String[] smoothContents = matchMethod("smooth", searchArea); | |
| 315 | 316 | if (smoothContents != null) { | |
| 316 | - smoothStatement = smoothContents[0]; | ||
| 317 | + extraStatements.append(smoothContents[0]); | ||
| 317 | 318 | } | |
| 318 | 319 | String[] noContents = matchMethod("noSmooth", searchArea); | |
| 319 | 320 | if (noContents != null) { | |
| 320 | - if (smoothStatement != null) { | ||
| 321 | + if (extraStatements != null) { | ||
| 321 | 322 | throw new SketchException("smooth() and noSmooth() cannot be used in the same sketch"); | |
| 322 | 323 | } else { | |
| 323 | - smoothStatement = noContents[0]; | ||
| 324 | + extraStatements.append(noContents[0]); | ||
| 324 | 325 | } | |
| 325 | 326 | } | |
| 327 | + String[] pixelDensityContents = matchMethod("pixelDensity", searchArea); | ||
| 328 | + if (pixelDensityContents != null) { | ||
| 329 | + extraStatements.append(pixelDensityContents[0]); | ||
| 330 | + } | ||
| 326 | 331 | ||
| 327 | 332 | String[] sizeContents = matchMethod("size", searchArea); | |
| 328 | 333 | String[] fullContents = matchMethod("fullScreen", searchArea); | |
@@ -364,8 +369,8 @@ make sure that it uses numbers (or displayWidth/Height), copy into settings | |||
| 364 | 369 | throw new SketchException("Please fix the size() line to continue.", false); | |
| 365 | 370 | } | |
| 366 | 371 | ||
| 367 | - if (smoothStatement != null) { | ||
| 368 | - info.statement += smoothStatement; | ||
| 372 | + if (extraStatements != null) { | ||
| 373 | + info.statement += extraStatements; | ||
| 369 | 374 | } | |
| 370 | 375 | info.checkEmpty(); | |
| 371 | 376 | return info; | |
@@ -396,18 +401,18 @@ make sure that it uses numbers (or displayWidth/Height), copy into settings | |||
| 396 | 401 | } | |
| 397 | 402 | info.width = "displayWidth"; | |
| 398 | 403 | info.height = "displayHeight"; | |
| 399 | - if (smoothStatement != null) { | ||
| 400 | - info.statement += smoothStatement; | ||
| 404 | + if (extraStatements != null) { | ||
| 405 | + info.statement += extraStatements.join(" "); | ||
| 401 | 406 | } | |
| 402 | 407 | info.checkEmpty(); | |
| 403 | 408 | return info; | |
| 404 | 409 | } | |
| 405 | 410 | ||
| 406 | 411 | // Made it this far, but no size() or fullScreen(), and still | |
| 407 | 412 | // need to pull out the noSmooth() and smooth(N) methods. | |
| 408 | - if (smoothStatement != null) { | ||
| 413 | + if (extraStatements != null) { | ||
| 409 | 414 | SurfaceInfo info = new SurfaceInfo(); | |
| 410 | - info.statement = smoothStatement; | ||
| 415 | + info.statement = extraStatements.join(" "); | ||
| 411 | 416 | return info; | |
| 412 | 417 | } | |
| 413 | 418 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments