Fix computation of AutomationController steps
smallstep (resp. largestep) is intended to be the interface delta corresponding to a desc.smallstep (resp. largestep) in internal scale, and is computed by incrementing from desc.lower. But ac->internal_to_interface(desc.lower) isn't necessarily zero. In fact it currently is 0.5 / (M - m + 1) for integer parameters where M is the maximum and m is the minimum possible value since it is the center of the [0,1/(M-m+1)] interval. Since the lower bound of the delta isn't always zero, don't ignore it when computing the actual increment.
This commit is contained in:
parent
0910df0cc7
commit
a982a7cc67
@ -142,8 +142,8 @@ AutomationController::create(const Evoral::Parameter& param,
|
|||||||
const double lo = ac->internal_to_interface(desc.lower);
|
const double lo = ac->internal_to_interface(desc.lower);
|
||||||
const double up = ac->internal_to_interface(desc.upper);
|
const double up = ac->internal_to_interface(desc.upper);
|
||||||
const double normal = ac->internal_to_interface(desc.normal);
|
const double normal = ac->internal_to_interface(desc.normal);
|
||||||
const double smallstep = ac->internal_to_interface(desc.lower + desc.smallstep);
|
const double smallstep = ac->internal_to_interface(desc.lower + desc.smallstep) - lo;
|
||||||
const double largestep = ac->internal_to_interface(desc.lower + desc.largestep);
|
const double largestep = ac->internal_to_interface(desc.lower + desc.largestep) - lo;
|
||||||
|
|
||||||
Gtk::Adjustment* adjustment = manage (
|
Gtk::Adjustment* adjustment = manage (
|
||||||
new Gtk::Adjustment (normal, lo, up, smallstep, largestep));
|
new Gtk::Adjustment (normal, lo, up, smallstep, largestep));
|
||||||
|
Loading…
Reference in New Issue
Block a user