mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-11 00:56:33 +01:00
add clamp for adding points to a ControlList from a (G)UI
This commit is contained in:
parent
fa828e0385
commit
129708ad85
1 changed files with 5 additions and 0 deletions
|
|
@ -492,6 +492,11 @@ ControlList::editor_add (double when, double value, bool with_guard)
|
||||||
maybe_add_insert_guard (when);
|
maybe_add_insert_guard (when);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* clamp new value to allowed range */
|
||||||
|
|
||||||
|
value = max (_min_yval, value);
|
||||||
|
value = min (_max_yval, value);
|
||||||
|
|
||||||
iterator result;
|
iterator result;
|
||||||
DEBUG_TRACE (DEBUG::ControlList, string_compose ("editor_add: actually add when= %1 value= %2\n", when, value));
|
DEBUG_TRACE (DEBUG::ControlList, string_compose ("editor_add: actually add when= %1 value= %2\n", when, value));
|
||||||
result = _events.insert (i, new ControlEvent (when, value));
|
result = _events.insert (i, new ControlEvent (when, value));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue