Browse Source

Allow grid warp source with one row or column

master
Krisjanis Rijnieks 9 years ago
parent
commit
0f35e210fc
  1. 4
      src/Application/ProjectionMappingState.cpp
  2. 2
      src/Commands/RmGridColCmd.cpp
  3. 2
      src/Commands/RmGridRowCmd.cpp

4
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(

2
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);

2
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);

Loading…
Cancel
Save