From 74c07b6234de8af71fe5b21aca867af7ace9dcd8 Mon Sep 17 00:00:00 2001 From: Krisjanis Rijnieks Date: Mon, 19 Sep 2016 11:39:12 +0200 Subject: [PATCH] Move mouseReleased from SurfaceManagerGui to states To ProjectionMappingState To TextureMappingState --- src/Application/States/ProjectionMappingState.cpp | 3 ++- src/Application/States/TextureMappingState.cpp | 5 ++++- src/Surfaces/SurfaceManagerGui.cpp | 6 +++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Application/States/ProjectionMappingState.cpp b/src/Application/States/ProjectionMappingState.cpp index 4dda66e..38a622f 100644 --- a/src/Application/States/ProjectionMappingState.cpp +++ b/src/Application/States/ProjectionMappingState.cpp @@ -291,7 +291,8 @@ void ProjectionMappingState::onMousePressed(Application * app, ofMouseEventArgs void ProjectionMappingState::onMouseReleased(Application * app, ofMouseEventArgs & args){ Gui::instance()->onMouseReleased(args); - app->getGui()->mouseReleased(args); + app->getGui()->stopDrag(); + app->getGui()->getProjectionEditor()->stopDragJoints(); } void ProjectionMappingState::onMouseDragged(Application * app, ofMouseEventArgs & args){ diff --git a/src/Application/States/TextureMappingState.cpp b/src/Application/States/TextureMappingState.cpp index f9fd4ff..bec0248 100644 --- a/src/Application/States/TextureMappingState.cpp +++ b/src/Application/States/TextureMappingState.cpp @@ -149,7 +149,10 @@ void TextureMappingState::onMouseReleased(Application * app, ofMouseEventArgs & // Alter mouse event args to match canvas translation args.x -= _canvasTranslate.x; args.y -= _canvasTranslate.y; - app->getGui()->mouseReleased(args); + + //app->getGui()->mouseReleased(args); + app->getGui()->stopDrag(); + app->getGui()->getTextureEditor()->stopDragJoints(); } void TextureMappingState::onMouseDragged(Application * app, ofMouseEventArgs & args){ diff --git a/src/Surfaces/SurfaceManagerGui.cpp b/src/Surfaces/SurfaceManagerGui.cpp index e02b01e..c8508a9 100644 --- a/src/Surfaces/SurfaceManagerGui.cpp +++ b/src/Surfaces/SurfaceManagerGui.cpp @@ -94,9 +94,9 @@ void SurfaceManagerGui::mousePressed(ofMouseEventArgs & args){ } void SurfaceManagerGui::mouseReleased(ofMouseEventArgs & args){ - stopDrag(); - projectionEditor.stopDragJoints(); - textureEditor.stopDragJoints(); + //stopDrag(); + //projectionEditor.stopDragJoints(); + //textureEditor.stopDragJoints(); } void SurfaceManagerGui::mouseDragged(ofMouseEventArgs & args){