Browse Source

Add ofxPiMapper::undo()

master
Krisjanis Rijnieks 8 years ago
parent
commit
2d95ccc0a6
  1. 6
      src/Application/Application.cpp
  2. 1
      src/Application/Application.h
  3. 4
      src/ofxPiMapper.cpp
  4. 1
      src/ofxPiMapper.h

6
src/Application/Application.cpp

@ -136,7 +136,7 @@ void Application::onKeyPressed(ofKeyEventArgs & args){
break; break;
case 'z': case 'z':
_cmdManager.undo(); undo();
break; break;
case 'n': case 'n':
@ -537,5 +537,9 @@ void Application::moveTexCoord(int texCoordIndex, ofVec2f by){
} }
} }
void Application::undo(){
_cmdManager.undo();
}
} // namespace piMapper } // namespace piMapper
} // namespace ofx } // namespace ofx

1
src/Application/Application.h

@ -131,6 +131,7 @@ class Application {
void moveTexCoord(int texCoordIndex, ofVec2f by); void moveTexCoord(int texCoordIndex, ofVec2f by);
// TODO: Add moveVertex. // TODO: Add moveVertex.
// Make it so that other parts of the application react to the change. // Make it so that other parts of the application react to the change.
void undo();
void setPreset(unsigned int i); void setPreset(unsigned int i);
void setNextPreset(); void setNextPreset();

4
src/ofxPiMapper.cpp

@ -202,6 +202,10 @@ void ofxPiMapper::toggleInfo(){
_application.toggleInfo(); _application.toggleInfo();
} }
void ofxPiMapper::undo(){
_application.undo();
}
void ofxPiMapper::setMode(ofx::piMapper::Mode m){ void ofxPiMapper::setMode(ofx::piMapper::Mode m){
if(m == ofx::piMapper::PRESENTATION_MODE){ if(m == ofx::piMapper::PRESENTATION_MODE){
_application.setPresentationMode(); _application.setPresentationMode();

1
src/ofxPiMapper.h

@ -28,6 +28,7 @@ class ofxPiMapper {
// Application // Application
void setInfoText(string text); void setInfoText(string text);
void toggleInfo(); void toggleInfo();
void undo();
// Modes // Modes
void setMode(ofx::piMapper::Mode m); void setMode(ofx::piMapper::Mode m);

Loading…
Cancel
Save