Browse Source

Execute DeselectTexCoordCmd only if a coord is selected

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

16
src/Application/States/TextureMappingState.cpp

@ -81,11 +81,21 @@ void TextureMappingState::onKeyPressed(Application * app, ofKeyEventArgs & args)
}
void TextureMappingState::onBackgroundPressed(Application * app, GuiBackgroundEvent & e){
app->getCmdManager()->exec(
new DeselectTexCoordCmd(app->getGui()->getTextureEditor()));
// 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;
}
}
_bTranslateCanvas = true;
if(selected){
app->getCmdManager()->exec(
new DeselectTexCoordCmd(app->getGui()->getTextureEditor()));
}
_bTranslateCanvas = true;
}
void TextureMappingState::onMousePressed(Application * app, ofMouseEventArgs & args){

Loading…
Cancel
Save