From 782717215d08152b6d82947e167bb3ebbfab1242 Mon Sep 17 00:00:00 2001 From: Krisjanis Rijnieks Date: Sat, 24 Sep 2016 14:39:04 +0300 Subject: [PATCH] Call ProjectionEditor::update() from ProjectionMappingState --- src/Application/States/ProjectionMappingState.cpp | 1 + src/UserInterface/ProjectionEditor.cpp | 6 +++--- src/UserInterface/ProjectionEditor.h | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Application/States/ProjectionMappingState.cpp b/src/Application/States/ProjectionMappingState.cpp index c043d24..d7b2186 100644 --- a/src/Application/States/ProjectionMappingState.cpp +++ b/src/Application/States/ProjectionMappingState.cpp @@ -17,6 +17,7 @@ ProjectionMappingState * ProjectionMappingState::instance(){ } void ProjectionMappingState::update(Application * app){ + app->getGui()->getProjectionEditor()->update(); Gui::instance()->getScaleWidget().update(); } diff --git a/src/UserInterface/ProjectionEditor.cpp b/src/UserInterface/ProjectionEditor.cpp index 4f0274a..1d6103d 100644 --- a/src/UserInterface/ProjectionEditor.cpp +++ b/src/UserInterface/ProjectionEditor.cpp @@ -17,12 +17,12 @@ ProjectionEditor::~ProjectionEditor(){ } void ProjectionEditor::registerAppEvents(){ - ofAddListener(ofEvents().update, this, &ProjectionEditor::update); + //ofAddListener(ofEvents().update, this, &ProjectionEditor::update); ofAddListener(ofEvents().messageEvent, this, &ProjectionEditor::gotMessage); } void ProjectionEditor::unregisterAppEvents(){ - ofRemoveListener(ofEvents().update, this, &ProjectionEditor::update); + //ofRemoveListener(ofEvents().update, this, &ProjectionEditor::update); ofRemoveListener(ofEvents().messageEvent, this, &ProjectionEditor::gotMessage); } @@ -46,7 +46,7 @@ void ProjectionEditor::disable(){ unregisterMouseEvents(); } -void ProjectionEditor::update(ofEventArgs & args){ +void ProjectionEditor::update(){ // update surface if one of the joints is being dragged for(int i = 0; i < joints.size(); i++){ if(joints[i]->isDragged() || joints[i]->isSelected()){ diff --git a/src/UserInterface/ProjectionEditor.h b/src/UserInterface/ProjectionEditor.h index f16fc62..98ccf91 100644 --- a/src/UserInterface/ProjectionEditor.h +++ b/src/UserInterface/ProjectionEditor.h @@ -20,7 +20,7 @@ class ProjectionEditor { void enable(); void disable(); - void update(ofEventArgs & args); + void update(); void draw(); void mouseDragged(ofMouseEventArgs & args); void gotMessage(ofMessage & msg);