diff options
author | Joshua Leung <aligorith@gmail.com> | 2017-09-11 09:24:39 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2017-09-11 10:37:00 +0300 |
commit | 9a9e9b1c4dace4f9beab0caae128588a1682049e (patch) | |
tree | ece919f94b1ef0b7c43c2dc7b3bc9c1f93f46aad | |
parent | 904831e62e46609623bb03b50f72bd093775bd87 (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!
-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) |