From e7a23a4a2b7b663c6507b65f499889cf89f31d23 Mon Sep 17 00:00:00 2001 From: Krisjanis Rijnieks Date: Thu, 15 Dec 2016 22:13:52 +0000 Subject: [PATCH] Hide/show layer panel on l press --- src/Application/Modes/ProjectionMappingMode.cpp | 12 ++++++++++-- src/Application/Modes/ProjectionMappingMode.h | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Application/Modes/ProjectionMappingMode.cpp b/src/Application/Modes/ProjectionMappingMode.cpp index 09a9b35..f16bcce 100644 --- a/src/Application/Modes/ProjectionMappingMode.cpp +++ b/src/Application/Modes/ProjectionMappingMode.cpp @@ -5,6 +5,7 @@ namespace piMapper { ProjectionMappingMode::ProjectionMappingMode(){ _surfaceScaleBeforeTransform = 1.0f; + _bDrawLayerPanel = true; } ProjectionMappingMode * ProjectionMappingMode::_instance = 0; @@ -41,7 +42,10 @@ void ProjectionMappingMode::draw(Application * app){ Gui::instance()->getScaleWidget().draw(); } - Gui::instance()->getLayerPanelWidget().draw(); + if(_bDrawLayerPanel){ + Gui::instance()->getLayerPanelWidget().draw(); + } + Gui::instance()->getSurfaceHighlightWidget().draw(); } @@ -291,7 +295,11 @@ void ProjectionMappingMode::onKeyPressed(Application * app, ofKeyEventArgs & arg app->getSurfaceManager()->getSelectedSurface()->getScale() - 0.2f)); } break; - + + case 'l': + _bDrawLayerPanel = !_bDrawLayerPanel; + break; + /* case 'n': // Set next preset app->getSurfaceManager()->setNextPreset(); diff --git a/src/Application/Modes/ProjectionMappingMode.h b/src/Application/Modes/ProjectionMappingMode.h index e6cc2df..802c80c 100644 --- a/src/Application/Modes/ProjectionMappingMode.h +++ b/src/Application/Modes/ProjectionMappingMode.h @@ -70,6 +70,7 @@ class ProjectionMappingMode : public ApplicationBaseMode { ofVec2f _clickPosition; bool _bSurfaceDrag; + bool _bDrawLayerPanel; };