Fix colored background not displayed in Bézier effect

CCBUG: 357659
parent 5dcde699
......@@ -12,7 +12,7 @@
<paramlistdisplay>Rec. 601,Rec. 709</paramlistdisplay>
<name>Luma formula</name>
</parameter>
<!-- No actual parameter: Represents the curve widget -->
<parameter type="curve" default="0" depends="Channel" number="Curve point number" inpoints="Point %i input value" outpoints="Point %i output value" min="1" max="5" />
......
......@@ -528,7 +528,8 @@ void ParameterContainer::meetDependency(const QString& name, const QString &type
} else if (type == "bezier_spline") {
BezierSplineWidget *widget = static_cast<BezierSplineWidget*>(m_valueItems[name]);
if (widget) {
widget->setMode((BezierSplineWidget::CurveModes)((int)(value.toDouble() * 10 + 0.5)));
QLocale locale;
widget->setMode((BezierSplineWidget::CurveModes)((int)(locale.toDouble(value) * 10 + 0.5)));
}
}
}
......
......@@ -32,7 +32,7 @@
BezierSplineWidget::BezierSplineWidget(const QString& spline, QWidget* parent) :
QWidget(parent),
m_mode(ModeRGB),
m_showPixmap(true)
m_showPixmap(false)
{
QVBoxLayout *layout = new QVBoxLayout(this);
layout->addWidget(&m_edit);
......@@ -121,16 +121,14 @@ void BezierSplineWidget::slotGridChange()
void BezierSplineWidget::slotShowPixmap(bool show)
{
if (m_showPixmap != show) {
m_showPixmap = show;
KdenliveSettings::setBezier_showpixmap(show);
if (show && (int)m_mode < 6)
m_edit.setPixmap(QPixmap::fromImage(ColorTools::rgbCurvePlane(m_edit.size(), static_cast<ColorTools::ColorsRGB>(m_mode), 1, palette().background().color().rgb())));
else if (show && m_mode == ModeHue)
m_edit.setPixmap(QPixmap::fromImage(ColorTools::hsvCurvePlane(m_edit.size(), QColor::fromHsv(200, 200, 200), ColorTools::COM_H, ColorTools::COM_H)));
else
m_edit.setPixmap(QPixmap());
}
m_showPixmap = show;
KdenliveSettings::setBezier_showpixmap(show);
if (show && (int)m_mode < 6)
m_edit.setPixmap(QPixmap::fromImage(ColorTools::rgbCurvePlane(m_edit.size(), static_cast<ColorTools::ColorsRGB>(m_mode), 1, palette().background().color().rgb())));
else if (show && m_mode == ModeHue)
m_edit.setPixmap(QPixmap::fromImage(ColorTools::hsvCurvePlane(m_edit.size(), QColor::fromHsv(200, 200, 200), ColorTools::COM_H, ColorTools::COM_H)));
else
m_edit.setPixmap(QPixmap());
}
void BezierSplineWidget::slotUpdatePointEntries(const BPoint &p)
......
......@@ -40,7 +40,7 @@ public:
/** The curvemodes refer to the usage of the spline.
* As this widget is currently only used for frei0r.curves the modes are the channels this filter accepts. */
enum CurveModes { ModeRed, ModeGreen, ModeBlue, ModeAlpha, ModeLuma, ModeRGB, ModeHue, ModeSaturation };
enum CurveModes { ModeRed = 0, ModeGreen, ModeBlue, ModeAlpha, ModeLuma, ModeRGB, ModeHue, ModeSaturation };
/** @brief Sets the mode to @param mode and updates the editors background pixmap if necessary. */
void setMode(CurveModes mode);
......
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