Fix effects like tracker broken on some locales

parent 952c69bb
......@@ -48,7 +48,7 @@
<name>Motion Tracker</name>
<description>Select a zone to follow its movements</description>
<author>Jean-Baptiste Mardelle</author>
<parameter type="geometry" name="rect" default="50%,50%:25%x25%" fixed="1" opacity="false" conditional="1">
<parameter type="geometry" name="rect" default="50% 50% 25% 25%" fixed="1" opacity="false" conditional="1">
<name>Rectangle</name>
</parameter>
<parameter type="list" name="algo" default="KCF" paramlist="KCF;CSRT;MOSSE;MIL;BOOSTING;TLD" conditional="1">
......
......@@ -226,8 +226,14 @@ void AssetParameterModel::internalSetParameter(const QString &name, const QStrin
m_params[pName].value = val;
}
}
bool conversionSuccess;
double doubleValue = locale.toDouble(paramValue, &conversionSuccess);
bool conversionSuccess = true;
double doubleValue = 0;
if (paramValue.simplified().contains(QLatin1Char(' '))) {
// Some locale interpret a space as thousands separator
conversionSuccess = false;
} else {
doubleValue = locale.toDouble(paramValue, &conversionSuccess);
}
if (conversionSuccess) {
m_asset->set(name.toLatin1().constData(), doubleValue);
if (m_fixedParams.count(name) == 0) {
......
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