From 2b83c5a3a77c125a9efd304246d33800adcf2bde Mon Sep 17 00:00:00 2001 From: Krisjanis Rijnieks Date: Fri, 9 May 2014 23:39:03 +0200 Subject: [PATCH] Add public selected variable --- src/ofxBaseJoint.cpp | 3 ++- src/ofxBaseJoint.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ofxBaseJoint.cpp b/src/ofxBaseJoint.cpp index 80c8e9d..80f2d27 100644 --- a/src/ofxBaseJoint.cpp +++ b/src/ofxBaseJoint.cpp @@ -29,7 +29,7 @@ void ofxBaseJoint::mouseReleased(ofMouseEventArgs &args) void ofxBaseJoint::mouseDragged(ofMouseEventArgs &args) { - if ( !dragging ) return; + if ( !dragging ) return; position = ofVec2f(args.x, args.y) + clickDistance; } @@ -56,6 +56,7 @@ void ofxBaseJoint::setDefaultProperties() position = ofVec2f(20.0f, 20.0f); clickDistance = ofVec2f(0.0f, 0.0f); dragging = false; + selected = false; } void ofxBaseJoint::registerAppEvents() diff --git a/src/ofxBaseJoint.h b/src/ofxBaseJoint.h index 2bc7c09..b72d01a 100644 --- a/src/ofxBaseJoint.h +++ b/src/ofxBaseJoint.h @@ -8,8 +8,10 @@ public: ofxBaseJoint(); ~ofxBaseJoint(); + ofVec2f position; bool enabled; bool visible; + bool selected; void mousePressed(ofMouseEventArgs& args); void mouseReleased(ofMouseEventArgs& args); @@ -24,7 +26,6 @@ public: protected: ofColor fillColor; ofColor strokeColor; - ofVec2f position; ofVec2f clickDistance; bool dragging;