Skip to content

Commit 97dd10c

Browse files
authored
*: Add cast from double to int (#155)
Signed-off-by: Ce Gao <[email protected]>
1 parent 672ecd7 commit 97dd10c

File tree

3 files changed

+26
-6
lines changed

3 files changed

+26
-6
lines changed

examples/Basics/BasicOperations/BasicOperations.rpde

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ellipse(56, 46, 55, 55)
1010

1111
quad(38, 31, 86, 20, 69, 63, 30, 76)
1212

13-
bezierDetail(as.integer(12))
13+
bezierDetail(12)
1414

1515
bezier(85, 20, 10, 10, 90, 90, 15, 80)
1616

examples/Basics/ThreeDimensionalCube/ThreeDimensionalCube.rpde

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
settings <- function() {
2-
size(500, 500, "processing.opengl.PGraphics3D")
2+
size(500, 500, P3D)
33
}
44

55
setup <- function() {
6-
colorMode(as.integer(1), 1)
6+
colorMode(1, 1)
77
frameRate(24)
88
}
99

src/rprocessing/applet/BuiltinApplet.java

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,26 @@ public void size(double width, double height, StringVector renderer) {
4242
super.size((int) width, (int) height, renderer.asString());
4343
}
4444

45+
public void bezierDetail(double detail) {
46+
super.bezierDetail((int) detail);
47+
}
48+
49+
public void colorMode(double mode) {
50+
super.colorMode((int) mode);
51+
}
52+
53+
public void colorMode(double mode, float max) {
54+
super.colorMode((int) mode, max);
55+
}
56+
57+
public void colorMode(double mode, float max1, float max2, float max3) {
58+
super.colorMode((int) mode, max1, max2, max3);
59+
}
60+
61+
public void colorMode(double mode, float max1, float max2, float max3, float maxA) {
62+
super.colorMode((int) mode, max1, max2, max3, maxA);
63+
}
64+
4565
public double frameCount() {
4666
return super.frameCount;
4767
}
@@ -128,9 +148,9 @@ protected void wrapKeyVariables() {
128148
if (lastKey != key) {
129149
lastKey = key;
130150
/*
131-
* If key is "CODED", i.e., an arrow key or other non-printable, pass that
132-
* value through as-is. If it's printable, convert it to a unicode string,
133-
* so that the user can compare key == 'x' instead of key == ord('x').
151+
* If key is "CODED", i.e., an arrow key or other non-printable, pass that value through
152+
* as-is. If it's printable, convert it to a unicode string, so that the user can compare key
153+
* == 'x' instead of key == ord('x').
134154
*/
135155
final char pyKey = key == CODED ? parseChar(Integer.valueOf(key)) : parseChar(key);
136156
this.renjinEngine.put("key", pyKey);

0 commit comments

Comments
 (0)