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