Browse Source

Create command on TextureMappingMode::moveSelection

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

24
src/Application/Modes/TextureMappingMode.cpp

@ -268,7 +268,29 @@ void TextureMappingMode::drawTexture(Application * app){
}
void TextureMappingMode::moveSelection(Application * app, ofVec2f by){
// TODO: Create an undoable command out of this
// TODO: Make the command mechanism more elegant than this
bool foundSelected = false;
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){
app->getCmdManager()->exec(new MvAllTexCoordsCmd(
app->getSurfaceManager()->getSelectedSurface(),
&Gui::instance()->getTextureEditorWidget()));
}
Gui::instance()->getTextureEditorWidget().moveSelection(by);
}

Loading…
Cancel
Save