Skip to content

Commit cb0b68f

Browse files
author
Jonathan Feinberg
committed
Expose the text() method that renders ints.
Fixes jdf/Processing.py-Bugs#105
1 parent c5e838b commit cb0b68f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

runtime/src/jycessing/PAppletJythonDriver.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -871,14 +871,19 @@ public PyObject __call__(final PyObject[] args, final String[] kws) {
871871
if (args.length == 3) {
872872
if (isString(a)) {
873873
text(a.asString(), x1, y1);
874+
} else if (a.getType() == PyInteger.TYPE) {
875+
text(a.asInt(), x1, y1);
874876
} else {
875877
text((float)a.asDouble(), x1, y1);
876878
}
877879
} else if (args.length == 4) {
880+
final float z1 = (float)args[3].asDouble();
878881
if (isString(a)) {
879-
text(a.asString(), x1, y1, (float)args[3].asDouble());
882+
text(a.asString(), x1, y1, z1);
883+
} else if (a.getType() == PyInteger.TYPE) {
884+
text(a.asInt(), x1, y1, z1);
880885
} else {
881-
text((float)a.asDouble(), x1, y1, (float)args[3].asDouble());
886+
text((float)a.asDouble(), x1, y1, z1);
882887
}
883888
} else /* 5 */{
884889
text(a.asString(), x1, y1, (float)args[3].asDouble(), (float)args[4].asDouble());

0 commit comments

Comments
 (0)