diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-09-15 03:34:00 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-09-15 03:34:00 +0400 |
commit | 37748b1e083db2f9643a2c30a1b15db32278df85 (patch) | |
tree | 360745cd2378c158203cdd1c6cf1f347c2407ac8 /source/blender | |
parent | a425790065fedb2ae49f1b79770945d8528790d9 (diff) |
fix [#32381] Sculpt: crash when using radius sensitivity
Diffstat (limited to 'source/blender')
-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 b53edeadb51..7657f78596a 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -254,7 +254,10 @@ static int paint_space_stroke(bContext *C, wmOperator *op, wmEvent *event, const pressure = event_tablet_data(event, NULL); if (pressure > FLT_EPSILON) { - scale = (BKE_brush_size_get(scene, stroke->brush) * pressure * stroke->brush->spacing / 50.0f) / length; + /* brushes can have a minimum size of 1.0 but with pressure it can be smaller then a pixel + * causing very high step sizes, hanging blender [#32381] */ + const float size_clamp = maxf(1.0f, BKE_brush_size_get(scene, stroke->brush) * pressure); + scale = (size_clamp * stroke->brush->spacing / 50.0f) / length; if (scale > FLT_EPSILON) { mul_v2_fl(vec, scale); |