Merge pull request #4220 from JakubValtar/fix-args-settings

Initialize sketch args before calling settings()
This commit is contained in:
Ben Fry
2016-02-13 09:11:40 -05:00
+7 -7
View File
@@ -10231,6 +10231,13 @@ public class PApplet implements PConstants {
// }
sketch.sketchPath = folder;
// Don't set 'args' to a zero-length array if it should be null [3.0a8]
if (args.length != argIndex + 1) {
// pass everything after the class name in as args to the sketch itself
// (fixed for 2.0a5, this was just subsetting by 1, which didn't skip opts)
sketch.args = PApplet.subset(args, argIndex + 1);
}
// Call the settings() method which will give us our size() call
// try {
sketch.handleSettings();
@@ -10252,13 +10259,6 @@ public class PApplet implements PConstants {
// //fullScreen |= sketch.sketchFullScreen();
// sketch.fullScreen |= fullScreen;
// Don't set 'args' to a zero-length array if it should be null [3.0a8]
if (args.length != argIndex + 1) {
// pass everything after the class name in as args to the sketch itself
// (fixed for 2.0a5, this was just subsetting by 1, which didn't skip opts)
sketch.args = PApplet.subset(args, argIndex + 1);
}
sketch.external = external;
if (windowColor != 0) {