[Bf-blender-cvs] [606af693fb5] master: Fix T70310: Difficult to change brush size from big to small

Pablo Dobarro noreply at git.blender.org
Wed Oct 2 15:58:29 CEST 2019


Commit: 606af693fb5119e68f8bcd6528f501d5c491f658
Author: Pablo Dobarro
Date:   Tue Oct 1 20:00:48 2019 +0200
Branches: master
https://developer.blender.org/rB606af693fb5119e68f8bcd6528f501d5c491f658

Fix T70310: Difficult to change brush size from big to small

Changing this values should only support horizontal movement as we are no longer trying to match the size of the cursor and the size of the circle preview in the widget.

Reviewed By: brecht

Maniphest Tasks: T70310

Differential Revision: https://developer.blender.org/D5931

===================================================================

M	source/blender/windowmanager/intern/wm_operators.c

===================================================================

diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 285379e90c6..69c535308e6 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -2621,38 +2621,34 @@ static int radial_control_modal(bContext *C, wmOperator *op, const wmEvent *even
             }
             else {
               delta[0] = rc->initial_mouse[0] - rc->slow_mouse[0];
-              delta[1] = rc->initial_mouse[1] - rc->slow_mouse[1];
+              delta[1] = 0.0f;
 
               if (rc->zoom_prop) {
                 RNA_property_float_get_array(&rc->zoom_ptr, rc->zoom_prop, zoom);
                 delta[0] /= zoom[0];
-                delta[1] /= zoom[1];
               }
 
               dist = len_v2(delta);
 
               delta[0] = event->x - rc->slow_mouse[0];
-              delta[1] = event->y - rc->slow_mouse[1];
 
               if (rc->zoom_prop) {
                 delta[0] /= zoom[0];
-                delta[1] /= zoom[1];
               }
 
-              dist = dist + 0.1f * (delta[0] + delta[1]);
+              dist = dist + 0.1f * (delta[0]);
             }
           }
           else {
             delta[0] = rc->initial_mouse[0] - event->x;
-            delta[1] = rc->initial_mouse[1] - event->y;
+            delta[1] = 0.0f;
 
             if (rc->zoom_prop) {
               RNA_property_float_get_array(&rc->zoom_ptr, rc->zoom_prop, zoom);
               delta[0] /= zoom[0];
-              delta[1] /= zoom[1];
             }
 
-            dist = len_v2(delta);
+            dist = clamp_f(-delta[0], 0.0f, FLT_MAX);
           }
 
           /* calculate new value and apply snapping  */



More information about the Bf-blender-cvs mailing list