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

Loading…
Cancel
Save