Skip to content

Commit 48d71a9

Browse files
committed
constant: Add height and width
Signed-off-by: Ce Gao <[email protected]>
1 parent b237ac5 commit 48d71a9

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

examples/Basics/BasicOperations/BasicOperations.rpde

+4-5
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@ bezierDetail(as.integer(12))
1414

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

17-
# for (i in 1:16) { t = i / float(steps); x = bezierPoint(85, 10, 90,
18-
# 15, t); y = bezierPoint(20, 10, 90, 80, t); tx =
19-
# bezierTangent(85, 10, 90, 15, t); ty = bezierTangent(20,
20-
# 10, 90, 80, t); a = atan2(ty, tx); a -= HALF_PI; line(x, y, cos(a)*8 + x,
21-
# sin(a)*8 + y); }
17+
# for (i in 1:16) { t = i / float(steps); x = bezierPoint(85, 10, 90, 15, t); y =
18+
# bezierPoint(20, 10, 90, 80, t); tx = bezierTangent(85, 10, 90, 15, t); ty =
19+
# bezierTangent(20, 10, 90, 80, t); a = atan2(ty, tx); a -= HALF_PI; line(x, y,
20+
# cos(a)*8 + x, sin(a)*8 + y); }
2221

2322
# bezierPoint
2423
for (i in 1:10) {

examples/Basics/Trigonometry/trigonometry.rpde

+2-3
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ draw <- function() {
5959
stroke(50)
6060
line(px, py, width/8 + radius + x, py)
6161

62-
# Output calculations to screen text('y <- sin x', 35, 185)
63-
# text('px <- ' + px, 105, 185) text('py <- ' + py, 215,
64-
# 185)
62+
# Output calculations to screen text('y <- sin x', 35, 185) text('px <- ' + px,
63+
# 105, 185) text('py <- ' + py, 215, 185)
6564
}

src/rprocessing/RLangPApplet.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -329,10 +329,10 @@ private boolean isMixMode() {
329329
protected void wrapProcessingVariables() {
330330
log("Wrap Processing built-in variables into R top context.");
331331
// TODO: Find some ways to push constants into R.
332-
// this.renjinEngine.put("width", width);
333-
// this.renjinEngine.put("height", height);
334-
// this.renjinEngine.put("displayWidth", displayWidth);
335-
// this.renjinEngine.put("displayHeight", displayHeight);
332+
this.renjinEngine.put("width", width);
333+
this.renjinEngine.put("height", height);
334+
this.renjinEngine.put("displayWidth", displayWidth);
335+
this.renjinEngine.put("displayHeight", displayHeight);
336336
// this.renjinEngine.put("focused", focused);
337337
// this.renjinEngine.put("keyPressed", keyPressed);
338338
}

src/rprocessing/r/core.R

+1
Original file line numberDiff line numberDiff line change
@@ -193,3 +193,4 @@ vertex = processing$vertex
193193

194194
# Hack
195195
frameCount = processing$frameCount
196+
# radians = processing$radians

0 commit comments

Comments
 (0)