From 5d7937a48271b9841122d42499239269ef616dad Mon Sep 17 00:00:00 2001 From: Krisjanis Rijnieks Date: Sat, 30 Jan 2016 19:47:41 +0100 Subject: [PATCH] Do not create `RmGridRowCmd` if surface rows are <= 1 --- src/Application/ProjectionMappingState.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Application/ProjectionMappingState.cpp b/src/Application/ProjectionMappingState.cpp index 5313916..ab6ddf2 100644 --- a/src/Application/ProjectionMappingState.cpp +++ b/src/Application/ProjectionMappingState.cpp @@ -84,11 +84,13 @@ void ProjectionMappingState::onKeyPressed(Application * app, ofKeyEventArgs & ar if(app->getSurfaceManager()->getSelectedSurface()->getType() == SurfaceType::GRID_WARP_SURFACE){ - // TODO: The command should not require projection editor pointer - app->getCmdManager()->exec( - new RmGridRowCmd( - (GridWarpSurface *)app->getSurfaceManager()->getSelectedSurface(), - app->getGui()->getProjectionEditor() )); + if(((GridWarpSurface *)app->getSurfaceManager()->getSelectedSurface())->getGridRows() > 1){ + // TODO: The command should not require projection editor pointer + app->getCmdManager()->exec( + new RmGridRowCmd( + (GridWarpSurface *)app->getSurfaceManager()->getSelectedSurface(), + app->getGui()->getProjectionEditor() )); + } } } break;