[apps/statistics] Forbid to set first drawn bar to high (where no bars

are drawn after)

Change-Id: Ib3fc5073d004abc4a3461a74bf2a6381f54d3aa2
This commit is contained in:
Émilie Feral
2017-04-27 14:47:39 +02:00
parent 9ebe2d5d62
commit f374f68b07

View File

@@ -58,7 +58,7 @@ bool HistogramParameterController::setParameterAtIndex(int parameterIndex, float
m_store->setBarWidth(f);
} else {
float newNumberOfBars = ceilf((m_store->maxValue() - f)/m_store->barWidth());
if (newNumberOfBars > Store::k_maxNumberOfBars) {
if (newNumberOfBars > Store::k_maxNumberOfBars || f > m_store->maxValue()+m_store->barWidth()) {
app()->displayWarning(I18n::Message::ForbiddenValue);
return false;
}