diff options
author | Joshua Leung <aligorith@gmail.com> | 2017-09-11 09:24:39 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2017-09-11 09:24:39 +0300 |
commit | 7e5687977287a0a8551a3593ebe60733b1c14af7 (patch) | |
tree | 951946352c84ff176f691009717a69dcfd35a0eb /source/blender/editors/sculpt_paint/paint_stroke.c | |
parent | 6d2cd1719b8e087041d54261db1e2a501f00c674 (diff) |
Fix T52696: Sculpt - Brush spacing pressure artifacts
Was caused by divide-by-zero in paint_stroke_integrate_overlap()
in paint_stroke.c, as identified by Bob Smith (uvwxyz).
Thanks for the report!
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_stroke.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_stroke.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c index 05270dbfa09..bb2cd52a41e 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -580,7 +580,10 @@ static float paint_stroke_integrate_overlap(Brush *br, float factor) max = overlap; } - return 1.0f / max; + if (max == 0.0f) + return 1.0f; + else + return 1.0f / max; } static float paint_space_stroke_spacing_variable(const Scene *scene, PaintStroke *stroke, float pressure, float dpressure, float length) |