[apps/statistics] Throw an error when the user set a negative value as

bin width

Change-Id: I0203ce403e469f4616af74399e451f6ed41d3024
This commit is contained in:
Émilie Feral
2016-12-21 16:46:22 +01:00
parent 1719569b65
commit 3c7ac73c5e
2 changed files with 7 additions and 0 deletions

View File

@@ -32,6 +32,10 @@ float HistogramParameterController::parameterAtIndex(int index) {
void HistogramParameterController::setParameterAtIndex(int parameterIndex, float f) {
assert(parameterIndex >= 0 && parameterIndex < 2);
if (parameterIndex == 0) {
if (f <= 0.0f) {
app()->displayWarning("Value interdite");
return;
}
m_data->setBinWidth(f);
} else {
m_data->setMinValue(f);