Skip to content

Commit 9da151e

Browse files
committed
fix more of size() parsing, get PDF working
1 parent 65f0be4 commit 9da151e

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

core/src/processing/core/PSurfaceNone.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ public PSurfaceNone(PGraphics graphics) {
4747
@Override
4848
public void initOffscreen(PApplet sketch) {
4949
this.sketch = sketch;
50+
51+
setSize(sketch.sketchWidth(), sketch.sketchHeight());
5052
}
5153

5254

@@ -59,7 +61,9 @@ public void initOffscreen(PApplet sketch) {
5961
public void initFrame(PApplet sketch, int backgroundColor,
6062
int deviceIndex, boolean fullScreen,
6163
boolean spanDisplays) {
62-
this.sketch = sketch;
64+
//this.sketch = sketch;
65+
throw new IllegalStateException("initFrame() not available with " +
66+
getClass().getSimpleName());
6367
}
6468

6569

java/src/processing/mode/java/preproc/PdePreprocessor.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ public PdePreprocessor(final String sketchName, final int tabSize) {
203203

204204
public String[] initSketchSize(String code, boolean sizeWarning) throws SketchException {
205205
String[] info = parseSketchSize(code, sizeWarning);
206+
//PApplet.printArray(info);
206207
if (info != null) {
207208
sizeStatement = info[0];
208209
sketchWidth = info[1];
@@ -274,8 +275,8 @@ static public String[] parseSketchSize(String code, boolean fussy) {
274275
//String[] matches = split on commas, but not commas inside quotes
275276

276277
StringList args = breakCommas(contents[1]);
277-
String width = args.get(0);
278-
String height = args.get(1);
278+
String width = args.get(0).trim();
279+
String height = args.get(1).trim();
279280
String renderer = (args.size() >= 3) ? args.get(2) : null;
280281
String path = (args.size() >= 4) ? args.get(3) : null;
281282

0 commit comments

Comments
 (0)