|
|
@ -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); |
|
|
|
} |
|
|
|
|
|
|
|