diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-12-18 06:35:15 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-12-18 06:35:15 +0300 |
commit | 076616898bff0acfc2336351ee975bd0fef944b2 (patch) | |
tree | d75210b7af56af60352c4d568141188fa188de67 /source/blender/editors | |
parent | 342a322a93361adf94511bec281428cd6bf2337a (diff) |
Fix T53577: Rake sculpt/paint wrong on first step
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_stroke.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c index 2c8e88e3ccb..c3055144b20 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -224,6 +224,9 @@ static bool paint_brush_update(bContext *C, UnifiedPaintSettings *ups = stroke->ups; bool location_sampled = false; bool location_success = false; + /* Use to perform all operations except applying the stroke, + * needed for operations that require cursor motion (rake). */ + bool is_dry_run = false; bool do_random = false; bool do_random_mask = false; /* XXX: Use pressure value from first brush step for brushes which don't @@ -362,7 +365,10 @@ static bool paint_brush_update(bContext *C, } /* curve strokes do their own rake calculation */ else if (!(brush->flag & BRUSH_CURVE)) { - paint_calculate_rake_rotation(ups, brush, mouse_init); + if (!paint_calculate_rake_rotation(ups, brush, mouse_init)) { + /* Not enough motion to define an angle. */ + is_dry_run = true; + } } } @@ -393,7 +399,7 @@ static bool paint_brush_update(bContext *C, } } - return location_success; + return location_success && (is_dry_run == false); } static bool paint_stroke_use_jitter(ePaintMode mode, Brush *brush, bool invert) |