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

Fix lift value incorrect on click

BUG: 431676
parent d4558cad
Pipeline #47902 passed with stage
in 13 minutes and 18 seconds
......@@ -25,6 +25,7 @@
#include <QVBoxLayout>
#include <QDoubleSpinBox>
#include <QLabel>
#include <QDebug>
#include <QFontDatabase>
#include <qmath.h>
......@@ -198,9 +199,11 @@ NegQColor WheelContainer::colorForPoint(const QPointF &point)
}
if (m_isInSquare) {
qreal value = 1.0 - qreal(point.y() - m_margin) / (wheelSize() - m_margin * 2);
qDebug()<<"== CLICK VALIE: "<<value;
if (!qFuzzyCompare(m_zeroShift, 0.)) {
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 {};
......
......@@ -59,7 +59,7 @@ LumaLiftGainParam::LumaLiftGainParam(std::shared_ptr<AssetParameterModel> model,
connect(this, &LumaLiftGainParam::liftChanged, [this, indexes]() {
NegQColor liftColor = m_lift->color();
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);
});
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