File tree Expand file tree Collapse file tree 6 files changed +12
-12
lines changed
chapters/intro_to_graphics/code
2_ii_b_Polyline_Brushes/src
2_ii_c_Save_Vector_Graphics/src Expand file tree Collapse file tree 6 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -39,11 +39,11 @@ void setup() {
39
39
40
40
void update() {
41
41
if (leftMouseButtonPressed) {
42
- ofVec2f mousePos(ofGetMouseX(), ofGetMouseY());
42
+ ofPoint mousePos(ofGetMouseX(), ofGetMouseY());
43
43
if (lastPoint.distance(mousePos) >= minDistance) {
44
44
// a.distance(b) calculates the Euclidean distance between point a and b. It's
45
45
// the straight line distance between the points.
46
- currentPolyline.curveTo(mousePos); // Here we are using an ofVec2f with curveTo(...)
46
+ currentPolyline.curveTo(mousePos);
47
47
lastPoint = mousePos;
48
48
}
49
49
}
Original file line number Diff line number Diff line change @@ -36,11 +36,11 @@ void ofApp::setup(){
36
36
// --------------------------------------------------------------
37
37
void ofApp::update (){
38
38
if (leftMouseButtonPressed) {
39
- ofVec2f mousePos (ofGetMouseX (), ofGetMouseY ());
39
+ ofPoint mousePos (ofGetMouseX (), ofGetMouseY ());
40
40
if (lastPoint.distance (mousePos) >= minDistance) {
41
41
// a.distance(b) calculates the Euclidean distance between point a and b. It's
42
42
// the straight line distance between the points.
43
- currentPolyline.curveTo (mousePos); // Here we are using an ofVec2f with curveTo(...)
43
+ currentPolyline.curveTo (mousePos);
44
44
lastPoint = mousePos;
45
45
}
46
46
}
Original file line number Diff line number Diff line change @@ -39,11 +39,11 @@ void setup() {
39
39
40
40
void update() {
41
41
if (leftMouseButtonPressed) {
42
- ofVec2f mousePos(ofGetMouseX(), ofGetMouseY());
42
+ ofPoint mousePos(ofGetMouseX(), ofGetMouseY());
43
43
if (lastPoint.distance(mousePos) >= minDistance) {
44
44
// a.distance(b) calculates the Euclidean distance between point a and b. It's
45
45
// the straight line distance between the points.
46
- currentPolyline.curveTo(mousePos); // Here we are using an ofVec2f with curveTo(...)
46
+ currentPolyline.curveTo(mousePos);
47
47
lastPoint = mousePos;
48
48
}
49
49
}
Original file line number Diff line number Diff line change @@ -36,11 +36,11 @@ void ofApp::setup(){
36
36
// --------------------------------------------------------------
37
37
void ofApp::update (){
38
38
if (leftMouseButtonPressed) {
39
- ofVec2f mousePos (ofGetMouseX (), ofGetMouseY ());
39
+ ofPoint mousePos (ofGetMouseX (), ofGetMouseY ());
40
40
if (lastPoint.distance (mousePos) >= minDistance) {
41
41
// a.distance(b) calculates the Euclidean distance between point a and b. It's
42
42
// the straight line distance between the points.
43
- currentPolyline.curveTo (mousePos); // Here we are using an ofVec2f with curveTo(...)
43
+ currentPolyline.curveTo (mousePos);
44
44
lastPoint = mousePos;
45
45
}
46
46
}
Original file line number Diff line number Diff line change @@ -42,11 +42,11 @@ void setup() {
42
42
43
43
void update() {
44
44
if (leftMouseButtonPressed) {
45
- ofVec2f mousePos(ofGetMouseX(), ofGetMouseY());
45
+ ofPoint mousePos(ofGetMouseX(), ofGetMouseY());
46
46
if (lastPoint.distance(mousePos) >= minDistance) {
47
47
// a.distance(b) calculates the Euclidean distance between point a and b. It's
48
48
// the straight line distance between the points.
49
- currentPolyline.curveTo(mousePos); // Here we are using an ofVec2f with curveTo(...)
49
+ currentPolyline.curveTo(mousePos);
50
50
lastPoint = mousePos;
51
51
}
52
52
}
Original file line number Diff line number Diff line change @@ -10,11 +10,11 @@ void ofApp::setup(){
10
10
// --------------------------------------------------------------
11
11
void ofApp::update (){
12
12
if (leftMouseButtonPressed) {
13
- ofVec2f mousePos (ofGetMouseX (), ofGetMouseY ());
13
+ ofPoint mousePos (ofGetMouseX (), ofGetMouseY ());
14
14
if (lastPoint.distance (mousePos) >= minDistance) {
15
15
// a.distance(b) calculates the Euclidean distance between point a and b. It's
16
16
// the straight line distance between the points.
17
- currentPolyline.curveTo (mousePos); // Here we are using an ofVec2f with curveTo(...)
17
+ currentPolyline.curveTo (mousePos);
18
18
lastPoint = mousePos;
19
19
}
20
20
}
You can’t perform that action at this time.
0 commit comments