Members of the KDE Community are recommended to subscribe to the kde-community mailing list at to allow them to participate in important discussions and receive other important announcements

Commit 47a57162 authored by Agata Cacko's avatar Agata Cacko

Fix curve change despite 'Use same curve' checked

Before this commit, if you have a preset like Fill_circle
that has "Use the same curve" checkbox checked and you were
clicking on other sensors, the curve would be back to the default
curve (the one that other sensors had) if you switch back and forth
between some sensors (like Pressure -> X-Tilt-> Pressure).

Also before this commit if you have the default uprising curve
and you switched Rotation -> Tilt elevation, the curve would change.

This commit fixes both behaviours (first by adding transferCurve(),
second by switching the line in kis_curve_widget).

This commit also includes two slot functions instead of one function
that were used as a slot for two different signals. It helps with
debugging signals and keeping stuff clear and ordered.

There is one problem left: if you switch Tilt elevation -> Distance
(using the 'hill' curve), the preset is set to modified even though
the curve doesn't change.

parent c091fce2
......@@ -525,8 +525,8 @@ void KisCurveWidget::setCurve(KisCubicCurve inlist)
d->m_curve = inlist;
d->m_grab_point_index = qBound(0, d->m_grab_point_index, d->m_curve.points().count() - 1);
emit pointSelectedChanged();
emit pointSelectedChanged();
void KisCurveWidget::leaveEvent(QEvent *)
......@@ -55,12 +55,12 @@ KisCurveOptionWidget::KisCurveOptionWidget(KisCurveOption* curveOption, const QS
connect(m_curveOptionWidget->curveWidget, SIGNAL(modified()), this, SLOT(transferCurve()));
connect(m_curveOptionWidget->curveWidget, SIGNAL(modified()), this, SLOT(slotModified()));
connect(m_curveOptionWidget->sensorSelector, SIGNAL(parametersChanged()), SLOT(emitSettingChanged()));
connect(m_curveOptionWidget->sensorSelector, SIGNAL(parametersChanged()), SLOT(updateLabelsOfCurrentSensor()));
connect(m_curveOptionWidget->sensorSelector, SIGNAL(highlightedSensorChanged(KisDynamicSensorSP)), SLOT(updateSensorCurveLabels(KisDynamicSensorSP)));
connect(m_curveOptionWidget->sensorSelector, SIGNAL(highlightedSensorChanged(KisDynamicSensorSP)), SLOT(updateCurve(KisDynamicSensorSP)));
connect(m_curveOptionWidget->checkBoxUseSameCurve, SIGNAL(stateChanged(int)), SLOT(transferCurve()));
connect(m_curveOptionWidget->checkBoxUseSameCurve, SIGNAL(stateChanged(int)), SLOT(slotStateChanged()));
// set all the icons for the curve preset shapes
......@@ -124,6 +124,11 @@ void KisCurveOptionWidget::readOptionSetting(const KisPropertiesConfigurationSP
if (m_curveOption->isSameCurveUsed()) {
// make sure the curve is transfered to all sensors to avoid updating from a wrong curve later
void KisCurveOptionWidget::lodLimitations(KisPaintopLodLimitations *l) const
......@@ -156,6 +161,17 @@ QWidget* KisCurveOptionWidget::curveWidget()
return m_widget;
void KisCurveOptionWidget::slotModified()
void KisCurveOptionWidget::slotStateChanged()
void KisCurveOptionWidget::transferCurve()
m_curveOptionWidget->sensorSelector->setCurrentCurve(m_curveOptionWidget->curveWidget->curve(), m_curveOptionWidget->checkBoxUseSameCurve->isChecked());
......@@ -53,6 +53,9 @@ protected:
private Q_SLOTS:
void slotModified();
void slotStateChanged();
void transferCurve();
void updateSensorCurveLabels(KisDynamicSensorSP sensor);
void updateCurve(KisDynamicSensorSP sensor);
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