Fix T74320: Sound strip waveforms drawing allows negative volume values

While animating sound strips volume within the graph editor, it is possible to set keyframes to negative values.
The drawing code of waveforms wasn't clamping these values to zero and was instead drawing an "inverted" curve

Author: a.monti

Reviewed By: iss

Differential Revision: https://developer.blender.org/D6971
This commit is contained in:
Richard Antalik
2020-03-02 02:49:35 +01:00
parent eaf0528749
commit e9e4f6af9e

View File

@@ -338,6 +338,7 @@ static void drawseqwave(View2D *v2d,
if (fcu && !BKE_fcurve_is_empty(fcu)) { if (fcu && !BKE_fcurve_is_empty(fcu)) {
float evaltime = x1_offset + (i * stepsize); float evaltime = x1_offset + (i * stepsize);
volume = evaluate_fcurve(fcu, evaltime); volume = evaluate_fcurve(fcu, evaltime);
CLAMP_MIN(volume, 0.0f);
} }
value1 *= volume; value1 *= volume;
value2 *= volume; value2 *= volume;