13
0

Single control points can now be dragged up and down properly.

- preserves the zero notch, but doesn't mess up the cumulative drag.
This commit is contained in:
nick_m 2015-06-18 04:42:30 +10:00
parent 639750f815
commit 0280989276

View File

@ -4091,11 +4091,6 @@ ControlPointDrag::motion (GdkEvent* event, bool)
// positive side of zero
double const zero_gain_y = (1.0 - _zero_gain_fraction) * _point->line().height() - .01;
// make sure we hit zero when passing through
if ((cy < zero_gain_y && (cy - dy) > zero_gain_y) || (cy > zero_gain_y && (cy - dy) < zero_gain_y)) {
cy = zero_gain_y;
}
if (_x_constrained) {
cx = _fixed_grab_x;
}
@ -4106,6 +4101,11 @@ ControlPointDrag::motion (GdkEvent* event, bool)
_cumulative_x_drag = cx - _fixed_grab_x;
_cumulative_y_drag = cy - _fixed_grab_y;
// make sure we hit zero when passing through
if ((cy < zero_gain_y && (cy - dy) > zero_gain_y) || (cy > zero_gain_y && (cy - dy) < zero_gain_y)) {
cy = zero_gain_y;
}
cx = max (0.0, cx);
cy = max (0.0, cy);
cy = min ((double) _point->line().height(), cy);