Browse Source

Execute DeselectTexCoordCmd only if a coord is selected

master
Krisjanis Rijnieks 9 years ago
parent
commit
c4204e61e6
  1. 12
      src/Application/States/TextureMappingState.cpp

12
src/Application/States/TextureMappingState.cpp

@ -81,11 +81,21 @@ void TextureMappingState::onKeyPressed(Application * app, ofKeyEventArgs & args)
} }
void TextureMappingState::onBackgroundPressed(Application * app, GuiBackgroundEvent & e){ void TextureMappingState::onBackgroundPressed(Application * app, GuiBackgroundEvent & e){
// Exec the command only if a joint is selected.
bool selected = false;
for(unsigned int i = 0; i < app->getGui()->getTextureEditor()->getJoints().size(); ++i){
if(app->getGui()->getTextureEditor()->getJoints()[i]->selected){
selected = true;
break;
}
}
if(selected){
app->getCmdManager()->exec( app->getCmdManager()->exec(
new DeselectTexCoordCmd(app->getGui()->getTextureEditor())); new DeselectTexCoordCmd(app->getGui()->getTextureEditor()));
}
_bTranslateCanvas = true; _bTranslateCanvas = true;
} }
void TextureMappingState::onMousePressed(Application * app, ofMouseEventArgs & args){ void TextureMappingState::onMousePressed(Application * app, ofMouseEventArgs & args){

Loading…
Cancel
Save