From 8db988ca875d51c39e2d51e147a81a5a063c4a85 Mon Sep 17 00:00:00 2001 From: Krisjanis Rijnieks Date: Sun, 23 Oct 2016 20:39:46 +0200 Subject: [PATCH] Prevent exec SelNext and SelPrevSurfaceCmd when no surfaces present --- src/Application/Modes/ProjectionMappingMode.cpp | 8 ++++++-- src/Gui/Widgets/SurfaceHighlightWidget.h | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Application/Modes/ProjectionMappingMode.cpp b/src/Application/Modes/ProjectionMappingMode.cpp index 8dd6b56..f2a1177 100644 --- a/src/Application/Modes/ProjectionMappingMode.cpp +++ b/src/Application/Modes/ProjectionMappingMode.cpp @@ -158,11 +158,15 @@ void ProjectionMappingMode::onKeyPressed(Application * app, ofKeyEventArgs & arg break; case '.': - app->getCmdManager()->exec(new SelNextSurfaceCmd(app->getSurfaceManager())); + if(app->getSurfaceManager()->size()){ + app->getCmdManager()->exec(new SelNextSurfaceCmd(app->getSurfaceManager())); + } break; case ',': - app->getCmdManager()->exec(new SelPrevSurfaceCmd(app->getSurfaceManager())); + if(app->getSurfaceManager()->size()){ + app->getCmdManager()->exec(new SelPrevSurfaceCmd(app->getSurfaceManager())); + } break; case '>': diff --git a/src/Gui/Widgets/SurfaceHighlightWidget.h b/src/Gui/Widgets/SurfaceHighlightWidget.h index ef48062..4eb7032 100644 --- a/src/Gui/Widgets/SurfaceHighlightWidget.h +++ b/src/Gui/Widgets/SurfaceHighlightWidget.h @@ -26,5 +26,5 @@ class SurfaceHighlightWidget : public GuiBaseWidget { SurfaceManager * _sm; }; -} // namespace piMapper +} // namespace piMappe } // namespace ofx \ No newline at end of file