curve could return values lower then zero, making a brush add and subtract the color in different parts. (cool but not useful!)

This commit is contained in:
2009-09-18 04:07:41 +00:00
parent 292e695a35
commit 2a21669e65

View File

@@ -933,8 +933,10 @@ int brush_painter_paint(BrushPainter *painter, BrushFunc func, float *pos, doubl
/* Uses the brush curve control to find a strength value between 0 and 1 */
float brush_curve_strength(Brush *br, float p, const float len)
{
float f;
if(p > len) p= len;
return curvemapping_evaluateF(br->curve, 0, p/len);
f= curvemapping_evaluateF(br->curve, 0, p/len);
return (f > 0.0f) ? f:0.0f;
}
/* TODO: should probably be unified with BrushPainter stuff? */