Commit 6b83942f authored by Wolthera van Hövell's avatar Wolthera van Hövell 🐛

Change shear to be in percentages as it is a ratio, not pixels.

parent 1eecb736
...@@ -40,12 +40,12 @@ KisWdgPattern::KisWdgPattern(QWidget* parent) ...@@ -40,12 +40,12 @@ KisWdgPattern::KisWdgPattern(QWidget* parent)
m_widget->setupUi(this); m_widget->setupUi(this);
m_widget->lblPattern->setVisible(false); m_widget->lblPattern->setVisible(false);
m_widget->sldShearX->setSuffix(i18n(" px")); m_widget->sldShearX->setSuffix(QChar(Qt::Key_Percent));
m_widget->sldShearY->setSuffix(i18n(" px")); m_widget->sldShearY->setSuffix(QChar(Qt::Key_Percent));
m_widget->sldShearX->setRange(-5.0, 5.0, 2); m_widget->sldShearX->setRange(-500, 500, 2);
m_widget->sldShearY->setRange(-5.0, 5.0, 2); m_widget->sldShearY->setRange(-500, 500, 2);
m_widget->sldShearX->setSingleStep(0.01); m_widget->sldShearX->setSingleStep(1);
m_widget->sldShearY->setSingleStep(0.01); m_widget->sldShearY->setSingleStep(1);
m_widget->sldShearX->setValue(0.0); m_widget->sldShearX->setValue(0.0);
m_widget->sldShearY->setValue(0.0); m_widget->sldShearY->setValue(0.0);
...@@ -100,12 +100,12 @@ void KisWdgPattern::setConfiguration(const KisPropertiesConfigurationSP config) ...@@ -100,12 +100,12 @@ void KisWdgPattern::setConfiguration(const KisPropertiesConfigurationSP config)
m_widget->spbOffsetX->setValue(config->getInt("transform_offset_x", 0)); m_widget->spbOffsetX->setValue(config->getInt("transform_offset_x", 0));
m_widget->spbOffsetY->setValue(config->getInt("transform_offset_y", 0)); m_widget->spbOffsetY->setValue(config->getInt("transform_offset_y", 0));
m_widget->spbScaleWidth->setValue(config->getInt("transform_scale_x", 1.0)*100); m_widget->spbScaleWidth->setValue(config->getInt("transform_scale_x", 1.0) * 100);
m_widget->spbScaleHeight->setValue(config->getInt("transform_scale_y", 1.0)*100); m_widget->spbScaleHeight->setValue(config->getInt("transform_scale_y", 1.0) * 100);
m_widget->btnLockAspectRatio->setKeepAspectRatio(config->getBool("transform_keep_scale_aspect", true)); m_widget->btnLockAspectRatio->setKeepAspectRatio(config->getBool("transform_keep_scale_aspect", true));
m_widget->sldShearX->setValue(config->getDouble("transform_shear_x", 0.0)); m_widget->sldShearX->setValue(config->getDouble("transform_shear_x", 0.0) * 100);
m_widget->sldShearY->setValue(config->getDouble("transform_shear_y", 0.0)); m_widget->sldShearY->setValue(config->getDouble("transform_shear_y", 0.0) * 100);
widget()->sldRotationX->setValue(config->getDouble("transform_rotation_x", 0.0)); widget()->sldRotationX->setValue(config->getDouble("transform_rotation_x", 0.0));
widget()->sldRotationY->setValue(config->getDouble("transform_rotation_y", 0.0)); widget()->sldRotationY->setValue(config->getDouble("transform_rotation_y", 0.0));
...@@ -126,13 +126,13 @@ KisPropertiesConfigurationSP KisWdgPattern::configuration() const ...@@ -126,13 +126,13 @@ KisPropertiesConfigurationSP KisWdgPattern::configuration() const
config->setProperty("transform_offset_x", m_widget->spbOffsetX->value()); config->setProperty("transform_offset_x", m_widget->spbOffsetX->value());
config->setProperty("transform_offset_y", m_widget->spbOffsetY->value()); config->setProperty("transform_offset_y", m_widget->spbOffsetY->value());
config->setProperty("transform_scale_x", m_widget->spbScaleWidth->value()/100); config->setProperty("transform_scale_x", m_widget->spbScaleWidth->value() / 100);
config->setProperty("transform_scale_y", m_widget->spbScaleHeight->value()/100); config->setProperty("transform_scale_y", m_widget->spbScaleHeight->value() / 100);
config->setProperty("transform_keep_scale_aspect", m_widget->btnLockAspectRatio->keepAspectRatio()); config->setProperty("transform_keep_scale_aspect", m_widget->btnLockAspectRatio->keepAspectRatio());
config->setProperty("transform_shear_x", widget()->sldShearX->value()); config->setProperty("transform_shear_x", widget()->sldShearX->value() / 100);
config->setProperty("transform_shear_y", widget()->sldShearY->value()); config->setProperty("transform_shear_y", widget()->sldShearY->value() / 100);
config->setProperty("transform_rotation_x", widget()->sldRotationX->value()); config->setProperty("transform_rotation_x", widget()->sldRotationX->value());
config->setProperty("transform_rotation_y", widget()->sldRotationY->value()); config->setProperty("transform_rotation_y", widget()->sldRotationY->value());
......
...@@ -116,12 +116,12 @@ KisToolTransformConfigWidget::KisToolTransformConfigWidget(TransformTransactionP ...@@ -116,12 +116,12 @@ KisToolTransformConfigWidget::KisToolTransformConfigWidget(TransformTransactionP
// initialize values for free transform sliders // initialize values for free transform sliders
shearXBox->setSuffix(i18n(" px")); shearXBox->setSuffix(QChar(Qt::Key_Percent));
shearYBox->setSuffix(i18n(" px")); shearYBox->setSuffix(QChar(Qt::Key_Percent));
shearXBox->setRange(-5.0, 5.0, 2); shearXBox->setRange(-500, 500, 2);
shearYBox->setRange(-5.0, 5.0, 2); shearYBox->setRange(-500, 500, 2);
shearXBox->setSingleStep(0.01); shearXBox->setSingleStep(1);
shearYBox->setSingleStep(0.01); shearYBox->setSingleStep(1);
shearXBox->setValue(0.0); shearXBox->setValue(0.0);
shearYBox->setValue(0.0); shearYBox->setValue(0.0);
...@@ -553,8 +553,8 @@ void KisToolTransformConfigWidget::updateConfig(const ToolTransformArgs &config) ...@@ -553,8 +553,8 @@ void KisToolTransformConfigWidget::updateConfig(const ToolTransformArgs &config)
scaleXBox->setValue(config.scaleX() * 100.); scaleXBox->setValue(config.scaleX() * 100.);
scaleYBox->setValue(config.scaleY() * 100.); scaleYBox->setValue(config.scaleY() * 100.);
shearXBox->setValue(config.shearX()); shearXBox->setValue(config.shearX() * 100.);
shearYBox->setValue(config.shearY()); shearYBox->setValue(config.shearY() * 100.);
const QPointF anchorPoint = config.originalCenter() + config.rotationCenterOffset(); const QPointF anchorPoint = config.originalCenter() + config.rotationCenterOffset();
const KisTransformUtils::MatricesPack m(config); const KisTransformUtils::MatricesPack m(config);
...@@ -931,7 +931,7 @@ void KisToolTransformConfigWidget::slotSetShearX(qreal value) ...@@ -931,7 +931,7 @@ void KisToolTransformConfigWidget::slotSetShearX(qreal value)
{ {
KisTransformUtils::AnchorHolder keeper(config->transformAroundRotationCenter(), config); KisTransformUtils::AnchorHolder keeper(config->transformAroundRotationCenter(), config);
config->setShearX((double)value); config->setShearX((double)value / 100.);
} }
notifyConfigChanged(); notifyConfigChanged();
...@@ -946,7 +946,7 @@ void KisToolTransformConfigWidget::slotSetShearY(qreal value) ...@@ -946,7 +946,7 @@ void KisToolTransformConfigWidget::slotSetShearY(qreal value)
{ {
KisTransformUtils::AnchorHolder keeper(config->transformAroundRotationCenter(), config); KisTransformUtils::AnchorHolder keeper(config->transformAroundRotationCenter(), config);
config->setShearY((double)value); config->setShearY((double)value / 100.);
} }
......
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