Skip to content

Commit 01acfcc

Browse files
committed
Update code for #299 - ofVec2f => ofPoint
1 parent eabb14b commit 01acfcc

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

chapters/intro_to_graphics/code/2_ii_a_Polyline_Pen.sketch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ void setup() {
3939

4040
void update() {
4141
if (leftMouseButtonPressed) {
42-
ofVec2f mousePos(ofGetMouseX(), ofGetMouseY());
42+
ofPoint mousePos(ofGetMouseX(), ofGetMouseY());
4343
if (lastPoint.distance(mousePos) >= minDistance) {
4444
// a.distance(b) calculates the Euclidean distance between point a and b. It's
4545
// the straight line distance between the points.
46-
currentPolyline.curveTo(mousePos); // Here we are using an ofVec2f with curveTo(...)
46+
currentPolyline.curveTo(mousePos);
4747
lastPoint = mousePos;
4848
}
4949
}

chapters/intro_to_graphics/code/2_ii_a_Polyline_Pen/src/ofApp.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ void ofApp::setup(){
3636
//--------------------------------------------------------------
3737
void ofApp::update(){
3838
if (leftMouseButtonPressed) {
39-
ofVec2f mousePos(ofGetMouseX(), ofGetMouseY());
39+
ofPoint mousePos(ofGetMouseX(), ofGetMouseY());
4040
if (lastPoint.distance(mousePos) >= minDistance) {
4141
// a.distance(b) calculates the Euclidean distance between point a and b. It's
4242
// the straight line distance between the points.
43-
currentPolyline.curveTo(mousePos); // Here we are using an ofVec2f with curveTo(...)
43+
currentPolyline.curveTo(mousePos);
4444
lastPoint = mousePos;
4545
}
4646
}

chapters/intro_to_graphics/code/2_ii_b_Polyline_Brushes.sketch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ void setup() {
3939

4040
void update() {
4141
if (leftMouseButtonPressed) {
42-
ofVec2f mousePos(ofGetMouseX(), ofGetMouseY());
42+
ofPoint mousePos(ofGetMouseX(), ofGetMouseY());
4343
if (lastPoint.distance(mousePos) >= minDistance) {
4444
// a.distance(b) calculates the Euclidean distance between point a and b. It's
4545
// the straight line distance between the points.
46-
currentPolyline.curveTo(mousePos); // Here we are using an ofVec2f with curveTo(...)
46+
currentPolyline.curveTo(mousePos);
4747
lastPoint = mousePos;
4848
}
4949
}

chapters/intro_to_graphics/code/2_ii_b_Polyline_Brushes/src/ofApp.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ void ofApp::setup(){
3636
//--------------------------------------------------------------
3737
void ofApp::update(){
3838
if (leftMouseButtonPressed) {
39-
ofVec2f mousePos(ofGetMouseX(), ofGetMouseY());
39+
ofPoint mousePos(ofGetMouseX(), ofGetMouseY());
4040
if (lastPoint.distance(mousePos) >= minDistance) {
4141
// a.distance(b) calculates the Euclidean distance between point a and b. It's
4242
// the straight line distance between the points.
43-
currentPolyline.curveTo(mousePos); // Here we are using an ofVec2f with curveTo(...)
43+
currentPolyline.curveTo(mousePos);
4444
lastPoint = mousePos;
4545
}
4646
}

chapters/intro_to_graphics/code/2_ii_c_Save_Vector_Graphics.sketch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ void setup() {
4242

4343
void update() {
4444
if (leftMouseButtonPressed) {
45-
ofVec2f mousePos(ofGetMouseX(), ofGetMouseY());
45+
ofPoint mousePos(ofGetMouseX(), ofGetMouseY());
4646
if (lastPoint.distance(mousePos) >= minDistance) {
4747
// a.distance(b) calculates the Euclidean distance between point a and b. It's
4848
// the straight line distance between the points.
49-
currentPolyline.curveTo(mousePos); // Here we are using an ofVec2f with curveTo(...)
49+
currentPolyline.curveTo(mousePos);
5050
lastPoint = mousePos;
5151
}
5252
}

chapters/intro_to_graphics/code/2_ii_c_Save_Vector_Graphics/src/ofApp.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ void ofApp::setup(){
1010
//--------------------------------------------------------------
1111
void ofApp::update(){
1212
if (leftMouseButtonPressed) {
13-
ofVec2f mousePos(ofGetMouseX(), ofGetMouseY());
13+
ofPoint mousePos(ofGetMouseX(), ofGetMouseY());
1414
if (lastPoint.distance(mousePos) >= minDistance) {
1515
// a.distance(b) calculates the Euclidean distance between point a and b. It's
1616
// the straight line distance between the points.
17-
currentPolyline.curveTo(mousePos); // Here we are using an ofVec2f with curveTo(...)
17+
currentPolyline.curveTo(mousePos);
1818
lastPoint = mousePos;
1919
}
2020
}

0 commit comments

Comments
 (0)