Pass display density from PDE to sketches as a command line arg

This commit is contained in:
Jakub Valtar
2017-02-16 13:24:09 +01:00
parent d30f29f393
commit 6ac2529f80

View File

@@ -24,6 +24,7 @@ package processing.mode.java.runner;
import processing.app.*;
import processing.app.exec.StreamRedirectThread;
import processing.app.ui.Toolkit;
import processing.core.*;
import processing.data.StringList;
import processing.mode.java.JavaBuild;
@@ -466,6 +467,10 @@ public class Runner implements MessageConsumer {
// removed for 3.0a6 because it would break the args passed to sketches.
params.append(PApplet.ARGS_SKETCH_FOLDER + "=" + build.getSketchPath());
if (Toolkit.zoom(100) >= 200) { // Use 100 to bypass possible rounding in zoom()
params.append(PApplet.ARGS_DENSITY + "=2");
}
params.append(build.getSketchClassName());
}
// Add command-line arguments to be given to the sketch itself