fix for weight paint using values over 1.0 when blending,

since its possible to have a brush strength over 1.0, it was possible to paint weights which would over-shoot the intended weight.
This commit is contained in:
Campbell Barton
2013-02-25 03:45:56 +00:00
parent 7b7d38d821
commit d9e83818b5

View File

@@ -913,7 +913,8 @@ static float calc_vp_alpha_dl(VPaint *vp, ViewContext *vc,
BLI_INLINE float wval_blend(const float weight, const float paintval, const float alpha)
{
return (paintval * alpha) + (weight * (1.0f - alpha));
const float talpha = min_ff(alpha, 1.0f); /* blending with values over 1 doesn't make sense */
return (paintval * talpha) + (weight * (1.0f - talpha));
}
BLI_INLINE float wval_add(const float weight, const float paintval, const float alpha)
{