Browse Source

Make TextureMappingMode::moveSelection more elegant

master
Krisjanis Rijnieks 9 years ago
parent
commit
50e152f3d4
  1. 24
      src/Application/Modes/TextureMappingMode.cpp

24
src/Application/Modes/TextureMappingMode.cpp

@ -268,24 +268,14 @@ void TextureMappingMode::drawTexture(Application * app){
}
void TextureMappingMode::moveSelection(Application * app, ofVec2f by){
// TODO: Make the command mechanism more elegant than this
bool foundSelected = false;
int selectedTexCoord = Gui::instance()->getTextureEditorWidget().getSelectedTexCoord();
for(
unsigned int i = 0;
i < Gui::instance()->getTextureEditorWidget().getJoints().size();
++i){
if(Gui::instance()->getTextureEditorWidget().getJoints()[i]->isSelected()){
app->getCmdManager()->exec(
new MvTexCoordCmd(
i, &Gui::instance()->getTextureEditorWidget()));
foundSelected = true;
break;
}
}
if(!foundSelected){
if(selectedTexCoord >= 0){
app->getCmdManager()->exec(
new MvTexCoordCmd(
selectedTexCoord,
&Gui::instance()->getTextureEditorWidget()));
}else{
app->getCmdManager()->exec(new MvAllTexCoordsCmd(
app->getSurfaceManager()->getSelectedSurface(),
&Gui::instance()->getTextureEditorWidget()));

Loading…
Cancel
Save