2 changed files with 48 additions and 0 deletions
@ -0,0 +1,23 @@ |
|||||
|
#include "ScaleSurfaceDnCmd.h" |
||||
|
|
||||
|
namespace ofx { |
||||
|
namespace piMapper { |
||||
|
|
||||
|
ScaleSurfaceDnCmd::ScaleSurfaceDnCmd(BaseSurface * selectedSurface, float by){ |
||||
|
_selectedSurface = selectedSurface; |
||||
|
_by = by; |
||||
|
} |
||||
|
|
||||
|
void ScaleSurfaceDnCmd::exec(){ |
||||
|
ofLogNotice("ScaleSurfaceDnCmd", "exec"); |
||||
|
_selectedSurface->scaleTo(1.0f - _by); |
||||
|
} |
||||
|
|
||||
|
void ScaleSurfaceDnCmd::undo(){ |
||||
|
ofLogNotice("ScaleSurfaceCmd", "undo"); |
||||
|
_selectedSurface->scaleTo(1.0f / (1.0f - _by)); |
||||
|
} |
||||
|
|
||||
|
} // namespace piMapper
|
||||
|
} // namespace ofx
|
||||
|
|
@ -0,0 +1,25 @@ |
|||||
|
#pragma once |
||||
|
|
||||
|
#include "BaseCmd.h" |
||||
|
#include "BaseSurface.h" |
||||
|
|
||||
|
namespace ofx { |
||||
|
namespace piMapper { |
||||
|
|
||||
|
class ScaleSurfaceDnCmd : public BaseUndoCmd { |
||||
|
|
||||
|
public: |
||||
|
ScaleSurfaceDnCmd(BaseSurface * selectedSurface, float by); |
||||
|
void exec(); |
||||
|
void undo(); |
||||
|
|
||||
|
private: |
||||
|
BaseSurface * _selectedSurface; |
||||
|
|
||||
|
float _by; |
||||
|
|
||||
|
}; |
||||
|
|
||||
|
} // namespace piMapper
|
||||
|
} // namespace ofx
|
||||
|
|
Loading…
Reference in new issue