Commit fb0e09ba authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix lift value incorrect on click

BUG: 431676
parent 3b5b1d4f
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <QVBoxLayout> #include <QVBoxLayout>
#include <QDoubleSpinBox> #include <QDoubleSpinBox>
#include <QLabel> #include <QLabel>
#include <QDebug>
#include <QFontDatabase> #include <QFontDatabase>
#include <qmath.h> #include <qmath.h>
...@@ -198,9 +199,11 @@ NegQColor WheelContainer::colorForPoint(const QPointF &point) ...@@ -198,9 +199,11 @@ NegQColor WheelContainer::colorForPoint(const QPointF &point)
} }
if (m_isInSquare) { if (m_isInSquare) {
qreal value = 1.0 - qreal(point.y() - m_margin) / (wheelSize() - m_margin * 2); qreal value = 1.0 - qreal(point.y() - m_margin) / (wheelSize() - m_margin * 2);
qDebug()<<"== CLICK VALIE: "<<value;
if (!qFuzzyCompare(m_zeroShift, 0.)) { if (!qFuzzyCompare(m_zeroShift, 0.)) {
value = value - m_zeroShift; value = value - m_zeroShift;
} }
qDebug()<<"== CLICK VALIE AFTER SHIFT: "<<value<<", SIZE F: "<<m_sizeFactor;
return NegQColor::fromHsvF(m_color.hueF(), m_color.saturationF(), value); return NegQColor::fromHsvF(m_color.hueF(), m_color.saturationF(), value);
} }
return {}; return {};
......
...@@ -59,7 +59,7 @@ LumaLiftGainParam::LumaLiftGainParam(std::shared_ptr<AssetParameterModel> model, ...@@ -59,7 +59,7 @@ LumaLiftGainParam::LumaLiftGainParam(std::shared_ptr<AssetParameterModel> model,
connect(this, &LumaLiftGainParam::liftChanged, [this, indexes]() { connect(this, &LumaLiftGainParam::liftChanged, [this, indexes]() {
NegQColor liftColor = m_lift->color(); NegQColor liftColor = m_lift->color();
QList <QModelIndex> ixes{indexes.value(QStringLiteral("lift_r")),indexes.value(QStringLiteral("lift_g")), indexes.value(QStringLiteral("lift_b"))}; QList <QModelIndex> ixes{indexes.value(QStringLiteral("lift_r")),indexes.value(QStringLiteral("lift_g")), indexes.value(QStringLiteral("lift_b"))};
QStringList values {QString::number(liftColor.redF(), 'f'), QString::number(liftColor.greenF(), 'f'), QString::number(liftColor.blueF(), 'f')}; QStringList values {QString::number(liftColor.redF() * LIFT_FACTOR, 'f'), QString::number(liftColor.greenF() * LIFT_FACTOR, 'f'), QString::number(liftColor.blueF() * LIFT_FACTOR, 'f')};
emit valuesChanged(ixes, values, true); emit valuesChanged(ixes, values, true);
}); });
connect(this, &LumaLiftGainParam::gammaChanged, [this, indexes]() { connect(this, &LumaLiftGainParam::gammaChanged, [this, indexes]() {
......
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