You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
76 lines
1.6 KiB
C++
76 lines
1.6 KiB
C++
#include "stdafx.h"
|
|
#include "ActionScaleProperty.h"
|
|
#include "SigmaDoc.h"
|
|
#include "Visitor.h"
|
|
|
|
namespace NAction
|
|
{
|
|
CActionScaleProperty::CActionScaleProperty()
|
|
: CActionItem(nullptr, 0)
|
|
{
|
|
}
|
|
|
|
CActionScaleProperty::CActionScaleProperty(CSigmaDoc * ppDoc, UINT actionType)
|
|
: CActionItem(ppDoc, actionType),
|
|
m_pOne(0),
|
|
m_dxScale(0),
|
|
m_dyScale(0),
|
|
m_bPersonalEmbellish(FALSE),
|
|
m_bOwnerProperties(FALSE)
|
|
{
|
|
}
|
|
|
|
CActionScaleProperty::~CActionScaleProperty(void)
|
|
{
|
|
}
|
|
|
|
void CActionScaleProperty::SetProperty(double dxScale, double dyScale, BOOL bPersonalEmbellish, BOOL bOwnerProperties)
|
|
{
|
|
m_dxScale = dxScale;
|
|
m_dyScale = dyScale;
|
|
m_bPersonalEmbellish = bPersonalEmbellish;
|
|
m_bOwnerProperties = bOwnerProperties;
|
|
}
|
|
|
|
void CActionScaleProperty::SetCOneProperty(COne * pOne, double dxScale, double dyScale, BOOL bPersonalEmbellish, BOOL bOwnerProperties)
|
|
{
|
|
m_pOne = pOne;
|
|
m_dxScale = dxScale;
|
|
m_dyScale = dyScale;
|
|
m_bPersonalEmbellish = bPersonalEmbellish;
|
|
m_bOwnerProperties = bOwnerProperties;
|
|
}
|
|
|
|
void CActionScaleProperty::Undo(void)
|
|
{
|
|
if (m_pOne)
|
|
{
|
|
if (m_dxScale >0 && m_dyScale > 0)
|
|
m_pOne->ScaleProperty(1.0/m_dxScale, 1.0/m_dyScale, TRUE, TRUE);
|
|
|
|
}
|
|
else
|
|
{
|
|
GetDoc()->GetDraw()->ScaleProperty(1.0 / m_dxScale, 1.0 / m_dyScale, m_bPersonalEmbellish, m_bOwnerProperties);
|
|
}
|
|
}
|
|
|
|
void CActionScaleProperty::Redo(void)
|
|
{
|
|
if (m_pOne)
|
|
{
|
|
if (m_dxScale > 0 && m_dyScale > 0)
|
|
m_pOne->ScaleProperty(m_dxScale, m_dyScale, TRUE, TRUE);
|
|
|
|
}
|
|
else
|
|
{
|
|
GetDoc()->GetDraw()->ScaleProperty(m_dxScale, m_dyScale, m_bPersonalEmbellish, m_bOwnerProperties);
|
|
}
|
|
}
|
|
|
|
void CActionScaleProperty::accept(CActionVisitor& visitor)
|
|
{
|
|
visitor.visit(*this);
|
|
}
|
|
} |