From 8ddfe2b243da58f4726d626baf6534de62f162cd Mon Sep 17 00:00:00 2001 From: Krisjanis Rijnieks Date: Wed, 17 Aug 2016 21:12:21 +0200 Subject: [PATCH] Add shortcuts for `ScaleSurface*` commands --- src/Application/ProjectionMappingState.cpp | 16 ++++++++++++++++ src/Application/ProjectionMappingState.h | 2 ++ 2 files changed, 18 insertions(+) diff --git a/src/Application/ProjectionMappingState.cpp b/src/Application/ProjectionMappingState.cpp index 168ac4d..e78994c 100644 --- a/src/Application/ProjectionMappingState.cpp +++ b/src/Application/ProjectionMappingState.cpp @@ -272,6 +272,22 @@ void ProjectionMappingState::onKeyPressed(Application * app, ofKeyEventArgs & ar } break; + case '+': // Scale surface up + if(app->getSurfaceManager()->getSelectedSurface() != 0){ + app->getCmdManager()->exec( + new ScaleSurfaceUpCmd( + app->getSurfaceManager()->getSelectedSurface(), 0.1f)); + } + break; + + case '-': // Scale surface down + if(app->getSurfaceManager()->getSelectedSurface() != 0){ + app->getCmdManager()->exec( + new ScaleSurfaceDnCmd( + app->getSurfaceManager()->getSelectedSurface(), 0.1f)); + } + break; + default: break; } diff --git a/src/Application/ProjectionMappingState.h b/src/Application/ProjectionMappingState.h index c01ac74..83e5684 100644 --- a/src/Application/ProjectionMappingState.h +++ b/src/Application/ProjectionMappingState.h @@ -25,6 +25,8 @@ #include "ToggleAnimatedSourceCmd.h" #include "MvLayerUpCmd.h" #include "MvLayerDnCmd.h" +#include "ScaleSurfaceUpCmd.h" +#include "ScaleSurfaceDnCmd.h" #include "SurfaceType.h" #include "Gui.h"