Browse Source

Make TextureMappingMode::moveSelection more elegant

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

20
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;
i < Gui::instance()->getTextureEditorWidget().getJoints().size();
++i){
if(Gui::instance()->getTextureEditorWidget().getJoints()[i]->isSelected()){
app->getCmdManager()->exec( app->getCmdManager()->exec(
new MvTexCoordCmd( new MvTexCoordCmd(
i, &Gui::instance()->getTextureEditorWidget())); selectedTexCoord,
foundSelected = true; &Gui::instance()->getTextureEditorWidget()));
break; }else{
}
}
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