FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Adding pdf library imports so the examples work. · JonathanOBrien/processing@ef782fe · GitHub

Repository navigation

Commit ef782fe

Browse files
Yong Bakos
committed
Adding pdf library imports so the examples work.
References processing/processing_web#45
1 parent ea1cf50 commit ef782fe

3 files changed

Lines changed: 18 additions & 15 deletions

File tree

‎java/examples/Books/Processing Handbook/Illustrations/page_290/page_290.pde‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
// Based on code 32-07 (p. 297)
33

4+
import processing.pdf.*;
45

56
float inc = 0.0;
67

@@ -12,11 +13,11 @@ void setup() {
1213
}
1314

1415
void draw() {
15-
16+
1617
if(record) {
1718
beginRecord(PDF, "page_290.pdf");
1819
}
19-
20+
2021
stroke(0, 143);
2122
randomSeed(0);
2223
background(255);
@@ -33,12 +34,12 @@ void draw() {
3334
tail(i, 300, int(random(5, 12)), angle*random(1.0, 1.3));
3435
tail(i, 400, int(random(5, 12)), -angle*random(1.0, 1.3));
3536
}
36-
37+
3738
if(record) {
3839
endRecord();
39-
record = false;
40+
record = false;
4041
}
41-
42+
4243
}
4344

4445
void mousePressed() {

‎java/examples/Books/Processing Handbook/Illustrations/page_300/page_300.pde‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
// Based on code 33-14 (p. 307)
33

4+
import processing.pdf.*;
45

56
float inc = 0.0;
67

@@ -17,7 +18,7 @@ void setup() {
1718
size(180, 666);
1819
smooth();
1920
noFill();
20-
strokeWeight(0.25);
21+
strokeWeight(0.25);
2122
y = new float[height];
2223
x = new float[height];
2324

@@ -32,9 +33,9 @@ void draw() {
3233
background(255);
3334

3435
// Shift the values to the right
35-
for (int i = y.length-1; i > 0; i--) {
36+
for (int i = y.length-1; i > 0; i--) {
3637
y[i] = y[i-1];
37-
}
38+
}
3839
// Add new values to the beginning
3940
my += (mouseX-my) * 0.1;
4041
y[0] = my;
@@ -46,9 +47,9 @@ void draw() {
4647
endShape();
4748

4849
// Shift the values to the right
49-
for (int i = x.length-1; i > 0; i--) {
50+
for (int i = x.length-1; i > 0; i--) {
5051
x[i] = x[i-1];
51-
}
52+
}
5253
// Add new values to the beginning
5354
mx += (mouseY-mx) * 0.1;
5455
x[0] = mx;
@@ -62,7 +63,7 @@ void draw() {
6263

6364
if(record) {
6465
endRecord();
65-
record = false;
66+
record = false;
6667
}
6768

6869
}

‎java/examples/Books/Processing Handbook/Illustrations/page_420/page_420.pde‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
11

22
// Based on code 45-04 (p. 424)
33

4+
import processing.pdf.*;
45

56
void setup() {
6-
size(513, 666);
7+
size(513, 666);
78
}
89

910
void draw() {
1011
if (mousePressed == true) {
1112
point(mouseX, mouseY);
1213
println("hi");
1314
}
14-
}
15+
}
1516

1617
void mousePressed() {
17-
beginRecord(PDF, "page_420.pdf");
18+
beginRecord(PDF, "page_420.pdf");
1819
background(255);
1920
stroke(0);
2021
strokeCap(ROUND);
2122
}
2223

2324
void mouseReleased() {
24-
endRecord();
25+
endRecord();
2526
}
2627

2728

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL