X Tutup
Skip to content

Commit 7350943

Browse files
committed
deal with path handling in renderers
1 parent 967ca2b commit 7350943

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

core/src/processing/core/PApplet.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1519,8 +1519,10 @@ public void size(final int w, final int h, String renderer, String path) {
15191519
throw new RuntimeException("The sketchRenderer() method is not implemented.");
15201520
}
15211521
}
1522-
surface.setSize(w, h);
1523-
g.setPath(path); // finally, a path
1522+
// size() shouldn't actually do anything here [3.0a8]
1523+
// surface.setSize(w, h);
1524+
// this won't be absolute, which will piss off PDF [3.0a8]
1525+
// g.setPath(path); // finally, a path
15241526

15251527
// // Run this from the EDT, just cuz it's AWT stuff (or maybe later Swing)
15261528
// EventQueue.invokeLater(new Runnable() {
@@ -1659,7 +1661,7 @@ public PGraphics createGraphics(int w, int h, String renderer) {
16591661
*/
16601662
public PGraphics createGraphics(int w, int h,
16611663
String renderer, String path) {
1662-
return makeGraphics(w, h, renderer, savePath(path), false);
1664+
return makeGraphics(w, h, renderer, path, false);
16631665
/*
16641666
if (path != null) {
16651667
path = savePath(path);
@@ -1680,9 +1682,7 @@ public PGraphics createGraphics(int w, int h,
16801682

16811683
/**
16821684
* Version of createGraphics() used internally.
1683-
* @param path A full (not relative) path.
1684-
* {@link PApplet#createGraphics} will call
1685-
* {@link PApplet#savePath} first.
1685+
* @param path A path (or null if none), can be absolute or relative ({@link PApplet#savePath} will be called)
16861686
*/
16871687
protected PGraphics makeGraphics(int w, int h,
16881688
String renderer, String path,
@@ -1712,9 +1712,8 @@ protected PGraphics makeGraphics(int w, int h,
17121712

17131713
pg.setParent(this);
17141714
pg.setPrimary(primary);
1715-
System.out.println("path is " + path);
17161715
if (path != null) {
1717-
pg.setPath(path);
1716+
pg.setPath(savePath(path));
17181717
}
17191718
// pg.setQuality(sketchQuality());
17201719
// if (!primary) {

java/libraries/pdf/src/processing/pdf/PGraphicsPDF.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ public void setPath(String path) {
7272
this.path = path;
7373
if (path != null) {
7474
file = new File(path);
75-
if (!file.isAbsolute()) file = null;
75+
if (!file.isAbsolute()) {
76+
file = null;
77+
}
7678
}
7779
if (file == null) {
7880
throw new RuntimeException("PGraphicsPDF requires an absolute path " +

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ 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);
207206
if (info != null) {
208207
sizeStatement = info[0];
209208
sketchWidth = info[1];

0 commit comments

Comments
 (0)
X Tutup