]> git.sesse.net Git - kdenlive/blobdiff - src/effectstackedit.cpp
Add proper support for 'float' parameter type in effect's drag widget (required for...
[kdenlive] / src / effectstackedit.cpp
index 0b1621e64b5250af1bf020d15df50d93395403e6..ad4df484dca03fa0cf5e70f9cb5164e1941ce38e 100644 (file)
@@ -259,19 +259,19 @@ void EffectStackEdit::transferParamDesc(const QDomElement d, ItemInfo info, bool
         /** See effects/README for info on the different types */
 
         if (type == "double" || type == "constant") {
-            int min;
-            int max;
+            double min;
+            double max;
             if (pa.attribute("min").startsWith('%'))
-                min = (int) ProfilesDialog::getStringEval(m_profile, pa.attribute("min"));
+                min = ProfilesDialog::getStringEval(m_profile, pa.attribute("min"));
             else
-                min = pa.attribute("min").toInt();
+                min = pa.attribute("min").toDouble();
             if (pa.attribute("max").startsWith('%'))
-                max = (int) ProfilesDialog::getStringEval(m_profile, pa.attribute("max"));
+                max = ProfilesDialog::getStringEval(m_profile, pa.attribute("max"));
             else
-                max = pa.attribute("max").toInt();
+                max = pa.attribute("max").toDouble();
 
-            DoubleParameterWidget *doubleparam = new DoubleParameterWidget(paramName, (int)(value.toDouble() + 0.5), min, max,
-                    pa.attribute("default").toInt(), comment, -1, pa.attribute("suffix"), this);
+            DoubleParameterWidget *doubleparam = new DoubleParameterWidget(paramName, value.toDouble(), min, max,
+                    pa.attribute("default").toDouble(), comment, -1, pa.attribute("suffix"), pa.attribute("decimals").toInt(), this);
             m_vbox->addWidget(doubleparam);
             m_valueItems[paramName] = doubleparam;
             connect(doubleparam, SIGNAL(valueChanged(int)), this, SLOT(collectAllParameters()));