Browse Source

Call ProjectionEditor::update() from ProjectionMappingState

master
Krisjanis Rijnieks 9 years ago
parent
commit
782717215d
  1. 1
      src/Application/States/ProjectionMappingState.cpp
  2. 6
      src/UserInterface/ProjectionEditor.cpp
  3. 2
      src/UserInterface/ProjectionEditor.h

1
src/Application/States/ProjectionMappingState.cpp

@ -17,6 +17,7 @@ ProjectionMappingState * ProjectionMappingState::instance(){
} }
void ProjectionMappingState::update(Application * app){ void ProjectionMappingState::update(Application * app){
app->getGui()->getProjectionEditor()->update();
Gui::instance()->getScaleWidget().update(); Gui::instance()->getScaleWidget().update();
} }

6
src/UserInterface/ProjectionEditor.cpp

@ -17,12 +17,12 @@ ProjectionEditor::~ProjectionEditor(){
} }
void ProjectionEditor::registerAppEvents(){ void ProjectionEditor::registerAppEvents(){
ofAddListener(ofEvents().update, this, &ProjectionEditor::update); //ofAddListener(ofEvents().update, this, &ProjectionEditor::update);
ofAddListener(ofEvents().messageEvent, this, &ProjectionEditor::gotMessage); ofAddListener(ofEvents().messageEvent, this, &ProjectionEditor::gotMessage);
} }
void ProjectionEditor::unregisterAppEvents(){ void ProjectionEditor::unregisterAppEvents(){
ofRemoveListener(ofEvents().update, this, &ProjectionEditor::update); //ofRemoveListener(ofEvents().update, this, &ProjectionEditor::update);
ofRemoveListener(ofEvents().messageEvent, this, ofRemoveListener(ofEvents().messageEvent, this,
&ProjectionEditor::gotMessage); &ProjectionEditor::gotMessage);
} }
@ -46,7 +46,7 @@ void ProjectionEditor::disable(){
unregisterMouseEvents(); unregisterMouseEvents();
} }
void ProjectionEditor::update(ofEventArgs & args){ void ProjectionEditor::update(){
// update surface if one of the joints is being dragged // update surface if one of the joints is being dragged
for(int i = 0; i < joints.size(); i++){ for(int i = 0; i < joints.size(); i++){
if(joints[i]->isDragged() || joints[i]->isSelected()){ if(joints[i]->isDragged() || joints[i]->isSelected()){

2
src/UserInterface/ProjectionEditor.h

@ -20,7 +20,7 @@ class ProjectionEditor {
void enable(); void enable();
void disable(); void disable();
void update(ofEventArgs & args); void update();
void draw(); void draw();
void mouseDragged(ofMouseEventArgs & args); void mouseDragged(ofMouseEventArgs & args);
void gotMessage(ofMessage & msg); void gotMessage(ofMessage & msg);

Loading…
Cancel
Save