From 555d0619f7bce393838edb4abef612e1fdf5f370 Mon Sep 17 00:00:00 2001 From: Krisjanis Rijnieks Date: Sun, 5 Jun 2016 16:11:10 +0200 Subject: [PATCH] Add deselect tex coord joints on background click --- src/Application/TextureMappingState.cpp | 6 +++++- src/Application/TextureMappingState.h | 1 + src/Surfaces/SurfaceManagerGui.cpp | 3 +-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Application/TextureMappingState.cpp b/src/Application/TextureMappingState.cpp index aa17755..40158b6 100644 --- a/src/Application/TextureMappingState.cpp +++ b/src/Application/TextureMappingState.cpp @@ -45,7 +45,11 @@ void TextureMappingState::onKeyPressed(Application * app, ofKeyEventArgs & args) } break; } - +} + +void TextureMappingState::onBackgroundPressed(Application * app, GuiBackgroundEvent & e){ + app->getCmdManager()->exec( + new DeselectTexCoordCmd(app->getGui()->getTextureEditor())); } } // namespace piMapper diff --git a/src/Application/TextureMappingState.h b/src/Application/TextureMappingState.h index b2aca60..dba6837 100644 --- a/src/Application/TextureMappingState.h +++ b/src/Application/TextureMappingState.h @@ -19,6 +19,7 @@ class TextureMappingState : public ApplicationBaseState { static TextureMappingState * instance(); void draw(Application * app); void onKeyPressed(Application * app, ofKeyEventArgs & args); + void onBackgroundPressed(Application * app, GuiBackgroundEvent & e); private: static TextureMappingState * _instance; diff --git a/src/Surfaces/SurfaceManagerGui.cpp b/src/Surfaces/SurfaceManagerGui.cpp index 679f16e..a04ef2d 100644 --- a/src/Surfaces/SurfaceManagerGui.cpp +++ b/src/Surfaces/SurfaceManagerGui.cpp @@ -125,8 +125,7 @@ void SurfaceManagerGui::mousePressed(ofMouseEventArgs & args){ &textureEditor)); }else{ - // TODO: Create command for this - textureEditor.unselectAllJoints(); + Gui::instance()->notifyBackgroundPressed(args); } }else if(guiMode == GuiMode::PROJECTION_MAPPING){