mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/graph][apps/sequence] When setting interval start bigger than
end, increase the end. Forbid to set the end greated than start Change-Id: Ib04186bc66ba94cd99ada8da82b0efc0a81ff7c0
This commit is contained in:
@@ -54,6 +54,16 @@ bool IntervalParameterController::setParameterAtIndex(int parameterIndex, float
|
||||
app()->displayWarning(I18n::Message::ForbiddenValue);
|
||||
return false;
|
||||
}
|
||||
float start = parameterIndex == 0 ? f : m_interval->start();
|
||||
float end = parameterIndex == 1 ? f : m_interval->end();
|
||||
if (start > end) {
|
||||
if (parameterIndex == 1) {
|
||||
app()->displayWarning(I18n::Message::ForbiddenValue);
|
||||
return false;
|
||||
}
|
||||
float g = f+1.0f;
|
||||
m_interval->setEnd(g);
|
||||
}
|
||||
SetterPointer setters[k_totalNumberOfCell] = {&Interval::setStart, &Interval::setEnd, &Interval::setStep};
|
||||
(m_interval->*setters[parameterIndex])(f);
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user