Skip to content

Commit

Permalink
edit to mouse actions
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotwoods committed May 20, 2014
1 parent 2fbd8c2 commit 932bfbe
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/ofxGrabCam.cpp
Expand Up @@ -46,7 +46,7 @@ void ofxGrabCam::end() {
//optimistically, we presume there's no stray push/pops
ofPopMatrix();

if ((pickCursorFlag || !mouseDown || !mouseActions) && !mouseWForced) {
if ((pickCursorFlag || drawCursor) && !mouseWForced && !mouseDown) {
findCursor();
pickCursorFlag = false;
}
Expand Down Expand Up @@ -181,15 +181,16 @@ void ofxGrabCam::mouseMoved(ofMouseEventArgs &args) {

//--------------------------
void ofxGrabCam::mousePressed(ofMouseEventArgs &args) {
if (!viewportRect.inside(args.x, args.y))
if (!viewportRect.inside(args.x, args.y) || !mouseActions)
return;

mouseP.x = args.x;
mouseP.y = args.y;

if (viewportRect.inside(args.x, args.y)) {
if (!mouseDown)
if (!mouseDown) {
pickCursorFlag = true;
}
mouseDown = true;
} else {
mouseDown = false;
Expand Down

0 comments on commit 932bfbe

Please sign in to comment.