Commit 6ffb047a authored by Dmitry Kazakov's avatar Dmitry Kazakov

Rename "Scale From Pivot Point" into "Transform Around Pivot Point"

Ref T119
parent d9fd4e33
......@@ -487,7 +487,7 @@ void KisFreeTransformStrategy::continuePrimaryAction(const QPointF &mousePos,
}
// override scale static point if it is locked
if ((m_d->currentArgs.scaleFromRotationCenter() ^ altModifierActive) &&
if ((m_d->currentArgs.transformAroundRotationCenter() ^ altModifierActive) &&
!qFuzzyCompare(anchorPoint.y(), movingPoint.y())) {
staticPoint = anchorPoint;
......@@ -537,7 +537,7 @@ void KisFreeTransformStrategy::continuePrimaryAction(const QPointF &mousePos,
}
// override scale static point if it is locked
if ((m_d->currentArgs.scaleFromRotationCenter() ^ altModifierActive) &&
if ((m_d->currentArgs.transformAroundRotationCenter() ^ altModifierActive) &&
!qFuzzyCompare(anchorPoint.x(), movingPoint.x())) {
staticPoint = anchorPoint;
......@@ -590,7 +590,7 @@ void KisFreeTransformStrategy::continuePrimaryAction(const QPointF &mousePos,
}
// override scale static point if it is locked
if ((m_d->currentArgs.scaleFromRotationCenter() ^ altModifierActive) &&
if ((m_d->currentArgs.transformAroundRotationCenter() ^ altModifierActive) &&
!(qFuzzyCompare(anchorPoint.x(), movingPoint.x()) ||
qFuzzyCompare(anchorPoint.y(), movingPoint.y()))) {
......
......@@ -147,7 +147,7 @@ KisToolTransformConfigWidget::KisToolTransformConfigWidget(TransformTransactionP
connect(m_rotationCenterButtons, SIGNAL(buttonPressed(int)), this, SLOT(slotRotationCenterChanged(int)));
connect(btnScaleFromPivotPoint, SIGNAL(clicked(bool)), this, SLOT(slotScaleFromRotationCenter(bool)));
connect(btnTransformAroundPivotPoint, SIGNAL(clicked(bool)), this, SLOT(slotTransformAroundRotationCenter(bool)));
// Init Free Transform Values
connect(scaleXBox, SIGNAL(valueChanged(int)), this, SLOT(slotSetScaleX(int)));
......@@ -325,7 +325,7 @@ void KisToolTransformConfigWidget::slotUpdateIcons()
bottomRightButton->setIcon(KisIconUtils::loadIcon("arrow-downright"));
// TODO: change the icon!
btnScaleFromPivotPoint->setIcon(KisIconUtils::loadIcon("transform_icons_liquify_main"));
btnTransformAroundPivotPoint->setIcon(KisIconUtils::loadIcon("transform_icons_liquify_main"));
// pressure icons
......@@ -577,7 +577,7 @@ void KisToolTransformConfigWidget::updateConfig(const ToolTransformArgs &config)
}
}
btnScaleFromPivotPoint->setChecked(config.scaleFromRotationCenter());
btnTransformAroundPivotPoint->setChecked(config.transformAroundRotationCenter());
} else if (config.mode() == ToolTransformArgs::WARP) {
......@@ -849,12 +849,12 @@ void KisToolTransformConfigWidget::slotRotationCenterChanged(int index)
}
}
void KisToolTransformConfigWidget::slotScaleFromRotationCenter(bool value)
void KisToolTransformConfigWidget::slotTransformAroundRotationCenter(bool value)
{
if (m_uiSlotsBlocked) return;
ToolTransformArgs *config = m_transaction->currentConfig();
config->setScaleFromRotationCenter(value);
config->setTransformAroundRotationCenter(value);
notifyConfigChanged();
notifyEditingFinished();
}
......@@ -866,7 +866,7 @@ void KisToolTransformConfigWidget::slotSetScaleX(int value)
ToolTransformArgs *config = m_transaction->currentConfig();
{
KisTransformUtils::AnchorHolder keeper(config->scaleFromRotationCenter(), config);
KisTransformUtils::AnchorHolder keeper(config->transformAroundRotationCenter(), config);
config->setScaleX(value / 100.);
}
......@@ -894,7 +894,7 @@ void KisToolTransformConfigWidget::slotSetScaleY(int value)
ToolTransformArgs *config = m_transaction->currentConfig();
{
KisTransformUtils::AnchorHolder keeper(config->scaleFromRotationCenter(), config);
KisTransformUtils::AnchorHolder keeper(config->transformAroundRotationCenter(), config);
config->setScaleY(value / 100.);
}
......@@ -919,7 +919,7 @@ void KisToolTransformConfigWidget::slotSetShearX(qreal value)
ToolTransformArgs *config = m_transaction->currentConfig();
{
KisTransformUtils::AnchorHolder keeper(config->scaleFromRotationCenter(), config);
KisTransformUtils::AnchorHolder keeper(config->transformAroundRotationCenter(), config);
config->setShearX((double)value);
}
......@@ -934,7 +934,7 @@ void KisToolTransformConfigWidget::slotSetShearY(qreal value)
ToolTransformArgs *config = m_transaction->currentConfig();
{
KisTransformUtils::AnchorHolder keeper(config->scaleFromRotationCenter(), config);
KisTransformUtils::AnchorHolder keeper(config->transformAroundRotationCenter(), config);
config->setShearY((double)value);
}
......@@ -967,7 +967,7 @@ void KisToolTransformConfigWidget::slotSetAX(qreal value)
ToolTransformArgs *config = m_transaction->currentConfig();
{
KisTransformUtils::AnchorHolder keeper(config->scaleFromRotationCenter(), config);
KisTransformUtils::AnchorHolder keeper(config->transformAroundRotationCenter(), config);
config->setAX(degreeToRadian((double)value));
}
notifyConfigChanged();
......@@ -981,7 +981,7 @@ void KisToolTransformConfigWidget::slotSetAY(qreal value)
ToolTransformArgs *config = m_transaction->currentConfig();
{
KisTransformUtils::AnchorHolder keeper(config->scaleFromRotationCenter(), config);
KisTransformUtils::AnchorHolder keeper(config->transformAroundRotationCenter(), config);
config->setAY(degreeToRadian((double)value));
}
......@@ -996,7 +996,7 @@ void KisToolTransformConfigWidget::slotSetAZ(qreal value)
ToolTransformArgs *config = m_transaction->currentConfig();
{
KisTransformUtils::AnchorHolder keeper(config->scaleFromRotationCenter(), config);
KisTransformUtils::AnchorHolder keeper(config->transformAroundRotationCenter(), config);
config->setAZ(degreeToRadian((double)value));
}
......@@ -1009,7 +1009,7 @@ void KisToolTransformConfigWidget::slotFlipX()
ToolTransformArgs *config = m_transaction->currentConfig();
{
KisTransformUtils::AnchorHolder keeper(config->scaleFromRotationCenter(), config);
KisTransformUtils::AnchorHolder keeper(config->transformAroundRotationCenter(), config);
config->setScaleX(config->scaleX() * -1);
}
......@@ -1022,7 +1022,7 @@ void KisToolTransformConfigWidget::slotFlipY()
ToolTransformArgs *config = m_transaction->currentConfig();
{
KisTransformUtils::AnchorHolder keeper(config->scaleFromRotationCenter(), config);
KisTransformUtils::AnchorHolder keeper(config->transformAroundRotationCenter(), config);
config->setScaleY(config->scaleY() * -1);
}
......@@ -1035,7 +1035,7 @@ void KisToolTransformConfigWidget::slotRotateCW()
ToolTransformArgs *config = m_transaction->currentConfig();
{
KisTransformUtils::AnchorHolder keeper(config->scaleFromRotationCenter(), config);
KisTransformUtils::AnchorHolder keeper(config->transformAroundRotationCenter(), config);
config->setAZ(normalizeAngle(config->aZ() + M_PI_2));
}
......@@ -1048,7 +1048,7 @@ void KisToolTransformConfigWidget::slotRotateCCW()
ToolTransformArgs *config = m_transaction->currentConfig();
{
KisTransformUtils::AnchorHolder keeper(config->scaleFromRotationCenter(), config);
KisTransformUtils::AnchorHolder keeper(config->transformAroundRotationCenter(), config);
config->setAZ(normalizeAngle(config->aZ() - M_PI_2));
}
......
......@@ -56,7 +56,7 @@ public Q_SLOTS:
void slotFilterChanged(const KoID &filter);
void slotWarpTypeChanged(int index);
void slotRotationCenterChanged(int index);
void slotScaleFromRotationCenter(bool value);
void slotTransformAroundRotationCenter(bool value);
void slotSetScaleX(int value);
void slotSetScaleY(int value);
......
......@@ -55,7 +55,7 @@ ToolTransformArgs::ToolTransformArgs()
KConfigGroup configGroup = KSharedConfig::openConfig()->group("KisToolTransform");
QString savedFilterId = configGroup.readEntry("filterId", "Bicubic");
setFilterId(savedFilterId);
m_scaleFromRotationCenter = configGroup.readEntry("scaleFromRotationCenter", "0").toInt();
m_transformAroundRotationCenter = configGroup.readEntry("transformAroundRotationCenter", "0").toInt();
m_editTransformPoints = false;
}
......@@ -69,12 +69,12 @@ void ToolTransformArgs::setFilterId(const QString &id) {
}
}
void ToolTransformArgs::setScaleFromRotationCenter(bool value)
void ToolTransformArgs::setTransformAroundRotationCenter(bool value)
{
m_scaleFromRotationCenter = value;
m_transformAroundRotationCenter = value;
KConfigGroup configGroup = KSharedConfig::openConfig()->group("KisToolTransform");
configGroup.writeEntry("scaleFromRotationCenter", int(value));
configGroup.writeEntry("transformAroundRotationCenter", int(value));
}
void ToolTransformArgs::init(const ToolTransformArgs& args)
......@@ -83,7 +83,7 @@ void ToolTransformArgs::init(const ToolTransformArgs& args)
m_transformedCenter = args.transformedCenter();
m_originalCenter = args.originalCenter();
m_rotationCenterOffset = args.rotationCenterOffset();
m_scaleFromRotationCenter = args.scaleFromRotationCenter();
m_transformAroundRotationCenter = args.transformAroundRotationCenter();
m_cameraPos = args.m_cameraPos;
m_aX = args.aX();
m_aY = args.aY();
......@@ -143,7 +143,7 @@ bool ToolTransformArgs::operator==(const ToolTransformArgs& other) const
m_transformedCenter == other.m_transformedCenter &&
m_originalCenter == other.m_originalCenter &&
m_rotationCenterOffset == other.m_rotationCenterOffset &&
m_scaleFromRotationCenter == other.m_scaleFromRotationCenter &&
m_transformAroundRotationCenter == other.m_transformAroundRotationCenter &&
m_aX == other.m_aX &&
m_aY == other.m_aY &&
m_aZ == other.m_aZ &&
......@@ -220,7 +220,7 @@ ToolTransformArgs::ToolTransformArgs(TransformMode mode,
QPointF transformedCenter,
QPointF originalCenter,
QPointF rotationCenterOffset,
bool scaleFromRotationCenter,
bool transformAroundRotationCenter,
double aX, double aY, double aZ,
double scaleX, double scaleY,
double shearX, double shearY,
......@@ -234,7 +234,7 @@ ToolTransformArgs::ToolTransformArgs(TransformMode mode,
m_transformedCenter = transformedCenter;
m_originalCenter = originalCenter;
m_rotationCenterOffset = rotationCenterOffset;
m_scaleFromRotationCenter = scaleFromRotationCenter;
m_transformAroundRotationCenter = transformAroundRotationCenter;
m_cameraPos = QVector3D(0,0,1024);
m_aX = aX;
m_aY = aY;
......@@ -331,7 +331,7 @@ void ToolTransformArgs::toXML(QDomElement *e) const
KisDomUtils::saveValue(&freeEl, "transformedCenter", m_transformedCenter);
KisDomUtils::saveValue(&freeEl, "originalCenter", m_originalCenter);
KisDomUtils::saveValue(&freeEl, "rotationCenterOffset", m_rotationCenterOffset);
KisDomUtils::saveValue(&freeEl, "scaleFromRotationCenter", m_scaleFromRotationCenter);
KisDomUtils::saveValue(&freeEl, "transformAroundRotationCenter", m_transformAroundRotationCenter);
KisDomUtils::saveValue(&freeEl, "aX", m_aX);
KisDomUtils::saveValue(&freeEl, "aY", m_aY);
......@@ -400,7 +400,7 @@ ToolTransformArgs ToolTransformArgs::fromXML(const QDomElement &e)
KisDomUtils::loadValue(freeEl, "transformedCenter", &args.m_transformedCenter) &&
KisDomUtils::loadValue(freeEl, "originalCenter", &args.m_originalCenter) &&
KisDomUtils::loadValue(freeEl, "rotationCenterOffset", &args.m_rotationCenterOffset) &&
KisDomUtils::loadValue(freeEl, "scaleFromRotationCenter", &args.m_scaleFromRotationCenter) &&
KisDomUtils::loadValue(freeEl, "transformAroundRotationCenter", &args.m_transformAroundRotationCenter) &&
KisDomUtils::loadValue(freeEl, "aX", &args.m_aX) &&
KisDomUtils::loadValue(freeEl, "aY", &args.m_aY) &&
......
......@@ -69,7 +69,7 @@ public:
ToolTransformArgs(TransformMode mode,
QPointF transformedCenter,
QPointF originalCenter,
QPointF rotationCenterOffset, bool scaleFromRotationCenter,
QPointF rotationCenterOffset, bool transformAroundRotationCenter,
double aX, double aY, double aZ,
double scaleX, double scaleY,
double shearX, double shearY,
......@@ -148,8 +148,8 @@ public:
inline QPointF rotationCenterOffset() const {
return m_rotationCenterOffset;
}
inline bool scaleFromRotationCenter() const {
return m_scaleFromRotationCenter;
inline bool transformAroundRotationCenter() const {
return m_transformAroundRotationCenter;
}
inline double aX() const {
return m_aX;
......@@ -188,7 +188,7 @@ public:
inline void setRotationCenterOffset(QPointF rotationCenterOffset) {
m_rotationCenterOffset = rotationCenterOffset;
}
void setScaleFromRotationCenter(bool value);
void setTransformAroundRotationCenter(bool value);
inline void setAX(double aX) {
KIS_ASSERT_RECOVER_NOOP(aX == normalizeAngle(aX));
m_aX = aX;
......@@ -293,8 +293,8 @@ private:
QPointF m_rotationCenterOffset; // the position of the rotation center relative to
// the original top left corner of the selection
// before any transformation
bool m_scaleFromRotationCenter; // In freehand mode makes the scaling be anchored to
// the rotation center point.
bool m_transformAroundRotationCenter; // In freehand mode makes the scaling and other transformations
// be anchored to the rotation center point.
double m_aX;
double m_aY;
......
......@@ -517,7 +517,7 @@
</widget>
</item>
<item row="1" column="0">
<widget class="QToolButton" name="btnScaleFromPivotPoint">
<widget class="QToolButton" name="btnTransformAroundPivotPoint">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
......@@ -525,7 +525,7 @@
</sizepolicy>
</property>
<property name="toolTip">
<string>Scale around pivot point (Alt)</string>
<string>Transform around pivot point (Alt)</string>
</property>
<property name="text">
<string/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment