You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
697 B
27 lines
697 B
#include "MvAllTexCoordsCmd.h"
|
|
|
|
namespace ofx {
|
|
namespace piMapper {
|
|
|
|
MvAllTexCoordsCmd::MvAllTexCoordsCmd(BaseSurface * surface, TextureEditorWidget * texEditor){
|
|
_surface = surface;
|
|
_texEditor = texEditor;
|
|
}
|
|
|
|
void MvAllTexCoordsCmd::exec(){
|
|
ofLogNotice("MvAllTexCoordsCmd", "exec");
|
|
_texCoords = _surface->getTexCoords();
|
|
}
|
|
|
|
void MvAllTexCoordsCmd::undo(){
|
|
ofLogNotice("MvAllTexCoordsCmd", "undo");
|
|
Vec2 dist = _texCoords[0] - _surface->getTexCoords()[0];
|
|
dist.x = _surface->getSource()->getTexture()->getWidth() * dist.x;
|
|
dist.y = _surface->getSource()->getTexture()->getHeight() * dist.y;
|
|
_texEditor->moveTexCoords(dist);
|
|
_surface = 0;
|
|
}
|
|
|
|
} // namespace piMapper
|
|
} // namespace ofx
|
|
|
|
|