From 0f35e210fc60a9dc75d8f80f614eb2cb98a11dcd Mon Sep 17 00:00:00 2001 From: Krisjanis Rijnieks Date: Thu, 25 Feb 2016 20:59:38 +0100 Subject: [PATCH] Allow grid warp source with one row or column --- src/Application/ProjectionMappingState.cpp | 4 ++-- src/Commands/RmGridColCmd.cpp | 2 +- src/Commands/RmGridRowCmd.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Application/ProjectionMappingState.cpp b/src/Application/ProjectionMappingState.cpp index 88fd909..16f6e6e 100644 --- a/src/Application/ProjectionMappingState.cpp +++ b/src/Application/ProjectionMappingState.cpp @@ -83,7 +83,7 @@ void ProjectionMappingState::onKeyPressed(Application * app, ofKeyEventArgs & ar if(app->getSurfaceManager()->getSelectedSurface()->getType() == SurfaceType::GRID_WARP_SURFACE){ - if(((GridWarpSurface *)app->getSurfaceManager()->getSelectedSurface())->getGridRows() > 2){ + if(((GridWarpSurface *)app->getSurfaceManager()->getSelectedSurface())->getGridRows() > 1){ // TODO: The command should not require projection editor pointer app->getCmdManager()->exec( new RmGridRowCmd( @@ -111,7 +111,7 @@ void ProjectionMappingState::onKeyPressed(Application * app, ofKeyEventArgs & ar if(app->getSurfaceManager()->getSelectedSurface()->getType() == SurfaceType::GRID_WARP_SURFACE){ - if(((GridWarpSurface *)app->getSurfaceManager()->getSelectedSurface())->getGridCols() > 2){ + if(((GridWarpSurface *)app->getSurfaceManager()->getSelectedSurface())->getGridCols() > 1){ // TODO: The command should not require projection editor pointer app->getCmdManager()->exec( new RmGridColCmd( diff --git a/src/Commands/RmGridColCmd.cpp b/src/Commands/RmGridColCmd.cpp index b732333..a8af6fc 100644 --- a/src/Commands/RmGridColCmd.cpp +++ b/src/Commands/RmGridColCmd.cpp @@ -12,7 +12,7 @@ void RmGridColCmd::exec(){ // TODO: Figure out nice math to not loose existing vertex positions - if(_surface->getGridCols() > 2){ + if(_surface->getGridCols() > 1){ _vertices = _surface->getVertices(); _texCoords = _surface->getTexCoords(); _surface->setGridCols(_surface->getGridCols() - 1); diff --git a/src/Commands/RmGridRowCmd.cpp b/src/Commands/RmGridRowCmd.cpp index 3ad16c5..3420d8b 100644 --- a/src/Commands/RmGridRowCmd.cpp +++ b/src/Commands/RmGridRowCmd.cpp @@ -12,7 +12,7 @@ void RmGridRowCmd::exec(){ // TODO: Figure out nice math to not loose existing vertex positions - if(_surface->getGridRows() > 2){ + if(_surface->getGridRows() > 1){ _vertices = _surface->getVertices(); _texCoords = _surface->getTexCoords(); _surface->setGridRows(_surface->getGridRows() - 1);