committed by
Krisjanis Rijnieks
14 changed files with 96 additions and 0 deletions
@ -0,0 +1,25 @@ |
|||||
|
#include "FullscreenSurfaceCmd.h" |
||||
|
|
||||
|
namespace ofx { |
||||
|
namespace piMapper { |
||||
|
|
||||
|
FullscreenSurfaceCmd::FullscreenSurfaceCmd(BaseSurface * surface){ |
||||
|
_surface = surface; |
||||
|
} |
||||
|
|
||||
|
void FullscreenSurfaceCmd::exec(){ |
||||
|
ofLogNotice("FullscreenSurfaceCmd", "exec"); |
||||
|
_previousVertices = _surface->getVertices(); |
||||
|
_surface->fullScreen(); |
||||
|
} |
||||
|
|
||||
|
void FullscreenSurfaceCmd::undo(){ |
||||
|
ofLogNotice("FullscreenSurfaceCmd", "undo"); |
||||
|
for(int i = 0; i < _surface->getVertices().size(); i++){ |
||||
|
_surface->setVertex(i,_previousVertices[i]); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} // namespace piMapper
|
||||
|
} // namespace ofx
|
||||
|
|
@ -0,0 +1,29 @@ |
|||||
|
// FullscreenSurfaceCmd
|
||||
|
// Makes selected surface resize to fit the screen
|
||||
|
// Created by Pierre Proske 25-03-2020
|
||||
|
|
||||
|
#pragma once |
||||
|
|
||||
|
#include "BaseCmd.h" |
||||
|
#include "BaseSurface.h" |
||||
|
#include "SurfaceManager.h" |
||||
|
#include "Vec3.h" |
||||
|
|
||||
|
namespace ofx { |
||||
|
namespace piMapper { |
||||
|
|
||||
|
class FullscreenSurfaceCmd : public BaseUndoCmd { |
||||
|
|
||||
|
public: |
||||
|
FullscreenSurfaceCmd(BaseSurface * surface); |
||||
|
void exec(); |
||||
|
void undo(); |
||||
|
|
||||
|
private: |
||||
|
BaseSurface * _surface; |
||||
|
std::vector<Vec3> _previousVertices; |
||||
|
}; |
||||
|
|
||||
|
} // namespace piMapper
|
||||
|
} // namespace ofx
|
||||
|
|
Loading…
Reference in new issue