fix [#26732] Colorband bug with compositing.

reported on IRC but submitted to the tracker for example file reference.
This commit is contained in:
Campbell Barton 2011-04-02 07:04:34 +00:00
parent 7690086d20
commit 3bc59fe771

@ -342,8 +342,11 @@ int do_colorband(ColorBand *coba, float in, float out[4])
if(cbd2->pos!=cbd1->pos)
fac= (in-cbd1->pos)/(cbd2->pos-cbd1->pos);
else
fac= 0.0f;
else {
/* was setting to 0.0 in 2.56 & previous, but this
* is incorrect for the last element, see [#26732] */
fac= (a != coba->tot) ? 0.0f : 1.0f;
}
if (coba->ipotype==4) {
/* constant */