diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-12-18 18:19:12 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-12-18 18:19:12 +0300 |
commit | c46a9d811789706e77db3d0b92f4b943fb86f386 (patch) | |
tree | b6ea007f13bb6cb831281594c4bea59f835544d8 /source/blender/blenkernel/intern | |
parent | 1fb43dcd5a7549f98a96faa41110ca22877003e5 (diff) | |
parent | 344eff9c4804f99b633c8054b888a8667ea24ddc (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/paint.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c index c88642a8164..11702236066 100644 --- a/source/blender/blenkernel/intern/paint.c +++ b/source/blender/blenkernel/intern/paint.c @@ -641,8 +641,9 @@ void paint_update_brush_rake_rotation(UnifiedPaintSettings *ups, Brush *brush, f ups->brush_rotation_sec = 0.0f; } -void paint_calculate_rake_rotation(UnifiedPaintSettings *ups, Brush *brush, const float mouse_pos[2]) +bool paint_calculate_rake_rotation(UnifiedPaintSettings *ups, Brush *brush, const float mouse_pos[2]) { + bool ok = false; if ((brush->mtex.brush_angle_mode & MTEX_ANGLE_RAKE) || (brush->mask_mtex.brush_angle_mode & MTEX_ANGLE_RAKE)) { const float r = RAKE_THRESHHOLD; float rotation; @@ -658,16 +659,20 @@ void paint_calculate_rake_rotation(UnifiedPaintSettings *ups, Brush *brush, cons ups->last_rake_angle = rotation; paint_update_brush_rake_rotation(ups, brush, rotation); + ok = true; } /* make sure we reset here to the last rotation to avoid accumulating * values in case a random rotation is also added */ else { paint_update_brush_rake_rotation(ups, brush, ups->last_rake_angle); + ok = false; } } else { ups->brush_rotation = ups->brush_rotation_sec = 0.0f; + ok = true; } + return ok; } void BKE_sculptsession_free_deformMats(SculptSession *ss) |