Browse Source

Add deselect and select surface in SetActivePresetCmd

master
Krisjanis Rijnieks 9 years ago
parent
commit
59490ad198
  1. 3
      src/Commands/SetActivePresetCmd.cpp
  2. 1
      src/Commands/SetActivePresetCmd.h

3
src/Commands/SetActivePresetCmd.cpp

@ -11,12 +11,15 @@ SetActivePresetCmd::SetActivePresetCmd(Application * app, unsigned int pi){
void SetActivePresetCmd::exec(){ void SetActivePresetCmd::exec(){
ofLogNotice("SetActivePresetCmd", "exec"); ofLogNotice("SetActivePresetCmd", "exec");
_prevPresetIndex = _app->getSurfaceManager()->getActivePresetIndex(); _prevPresetIndex = _app->getSurfaceManager()->getActivePresetIndex();
_app->getSurfaceManager()->deselectSurface();
_selectedSurfaceIndex = _app->getSurfaceManager()->getSelectedSurfaceIndex();
_app->getSurfaceManager()->setActivePreset(_newPresetIndex); _app->getSurfaceManager()->setActivePreset(_newPresetIndex);
} }
void SetActivePresetCmd::undo(){ void SetActivePresetCmd::undo(){
ofLogNotice("SetActivePresetCmd", "undo"); ofLogNotice("SetActivePresetCmd", "undo");
_app->getSurfaceManager()->setActivePreset(_prevPresetIndex); _app->getSurfaceManager()->setActivePreset(_prevPresetIndex);
_app->getSurfaceManager()->selectSurface(_selectedSurfaceIndex);
} }
} // namespace piMapper } // namespace piMapper

1
src/Commands/SetActivePresetCmd.h

@ -25,6 +25,7 @@ class SetActivePresetCmd : public BaseUndoCmd {
Application * _app; Application * _app;
unsigned int _newPresetIndex; unsigned int _newPresetIndex;
unsigned int _prevPresetIndex; unsigned int _prevPresetIndex;
int _selectedSurfaceIndex;
}; };
} // namespace piMapper } // namespace piMapper

Loading…
Cancel
Save