fix more of size() parsing, get PDF working

This commit is contained in:
Ben Fry
2015-05-16 09:09:04 -04:00
parent e52be3f71b
commit 1c2738be05
2 changed files with 8 additions and 3 deletions
+5 -1
View File
@@ -47,6 +47,8 @@ public class PSurfaceNone implements PSurface {
@Override
public void initOffscreen(PApplet sketch) {
this.sketch = sketch;
setSize(sketch.sketchWidth(), sketch.sketchHeight());
}
@@ -59,7 +61,9 @@ public class PSurfaceNone implements PSurface {
public void initFrame(PApplet sketch, int backgroundColor,
int deviceIndex, boolean fullScreen,
boolean spanDisplays) {
this.sketch = sketch;
//this.sketch = sketch;
throw new IllegalStateException("initFrame() not available with " +
getClass().getSimpleName());
}
@@ -203,6 +203,7 @@ public class PdePreprocessor {
public String[] initSketchSize(String code, boolean sizeWarning) throws SketchException {
String[] info = parseSketchSize(code, sizeWarning);
//PApplet.printArray(info);
if (info != null) {
sizeStatement = info[0];
sketchWidth = info[1];
@@ -274,8 +275,8 @@ public class PdePreprocessor {
//String[] matches = split on commas, but not commas inside quotes
StringList args = breakCommas(contents[1]);
String width = args.get(0);
String height = args.get(1);
String width = args.get(0).trim();
String height = args.get(1).trim();
String renderer = (args.size() >= 3) ? args.get(2) : null;
String path = (args.size() >= 4) ? args.get(3) : null;