-
Notifications
You must be signed in to change notification settings - Fork 239
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #317: Preproc behavior when size defined in user class.
Though this was already fixed, just adding a test to confirm that it stays fixed. Need to respect calls to user-definined size methods including those defined in user-made classes.
- Loading branch information
1 parent
c7d6cba
commit 30cee88
Showing
3 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import processing.core.*; | ||
import processing.data.*; | ||
import processing.event.*; | ||
import processing.opengl.*; | ||
|
||
import java.util.HashMap; | ||
import java.util.ArrayList; | ||
import java.io.File; | ||
import java.io.BufferedReader; | ||
import java.io.PrintWriter; | ||
import java.io.InputStream; | ||
import java.io.OutputStream; | ||
import java.io.IOException; | ||
|
||
public class sizeclass extends PApplet { | ||
|
||
// Thanks StanLepunK: https://github.com/processing/processing4/issues/317 | ||
Truc truc = new Truc(); | ||
|
||
public void setup() { | ||
/* size commented out by preprocessor */; | ||
truc.size(1,1); // problem >>> error \u00e0 "." | ||
// func(); | ||
} | ||
|
||
public void draw() { | ||
truc.size(1,1); // no problem | ||
} | ||
|
||
public void func() { | ||
truc.size(1,1); // no problem | ||
} | ||
|
||
class Truc { | ||
public void size(int x, int y) { | ||
} | ||
} | ||
|
||
|
||
public void settings() { size(200, 200); } | ||
|
||
static public void main(String[] passedArgs) { | ||
String[] appletArgs = new String[] { "sizeclass" }; | ||
if (passedArgs != null) { | ||
PApplet.main(concat(appletArgs, passedArgs)); | ||
} else { | ||
PApplet.main(appletArgs); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Thanks StanLepunK: https://github.com/processing/processing4/issues/317 | ||
Truc truc = new Truc(); | ||
|
||
void setup() { | ||
size(200,200); | ||
truc.size(1,1); // problem >>> error à "." | ||
// func(); | ||
} | ||
|
||
void draw() { | ||
truc.size(1,1); // no problem | ||
} | ||
|
||
void func() { | ||
truc.size(1,1); // no problem | ||
} | ||
|
||
class Truc { | ||
void size(int x, int y) { | ||
} | ||
} |