diff --git a/src/Application/Application.cpp b/src/Application/Application.cpp index 8182004..aa1813d 100644 --- a/src/Application/Application.cpp +++ b/src/Application/Application.cpp @@ -136,7 +136,7 @@ void Application::onKeyPressed(ofKeyEventArgs & args){ break; case 'z': - _cmdManager.undo(); + undo(); break; case 'n': @@ -537,5 +537,9 @@ void Application::moveTexCoord(int texCoordIndex, ofVec2f by){ } } +void Application::undo(){ + _cmdManager.undo(); +} + } // namespace piMapper } // namespace ofx diff --git a/src/Application/Application.h b/src/Application/Application.h index fdeab10..82528b7 100644 --- a/src/Application/Application.h +++ b/src/Application/Application.h @@ -131,6 +131,7 @@ class Application { void moveTexCoord(int texCoordIndex, ofVec2f by); // TODO: Add moveVertex. // Make it so that other parts of the application react to the change. + void undo(); void setPreset(unsigned int i); void setNextPreset(); diff --git a/src/ofxPiMapper.cpp b/src/ofxPiMapper.cpp index af1ea0f..e71be26 100644 --- a/src/ofxPiMapper.cpp +++ b/src/ofxPiMapper.cpp @@ -202,6 +202,10 @@ void ofxPiMapper::toggleInfo(){ _application.toggleInfo(); } +void ofxPiMapper::undo(){ + _application.undo(); +} + void ofxPiMapper::setMode(ofx::piMapper::Mode m){ if(m == ofx::piMapper::PRESENTATION_MODE){ _application.setPresentationMode(); diff --git a/src/ofxPiMapper.h b/src/ofxPiMapper.h index 7c8d433..460a76a 100644 --- a/src/ofxPiMapper.h +++ b/src/ofxPiMapper.h @@ -28,6 +28,7 @@ class ofxPiMapper { // Application void setInfoText(string text); void toggleInfo(); + void undo(); // Modes void setMode(ofx::piMapper::Mode m);