scale int number button sensitivity by the min/max range.
authorCampbell Barton <ideasman42@gmail.com>
Sun, 21 Feb 2010 16:43:25 +0000 (16:43 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 21 Feb 2010 16:43:25 +0000 (16:43 +0000)
source/blender/editors/interface/interface_handlers.c

index effd856828f3d8707312c0885f73598a3e847bc5..9624adf4879e8618dc9da8da4f9deba298087c71 100644 (file)
@@ -2190,7 +2190,9 @@ static int ui_numedit_but_NUM(uiBut *but, uiHandleButtonData *data, float fac, i
                        }
                }
                else {
-                       fac = 0.5; /* simple 2px == 1 */
+                       if(softrange > 256)             fac= 1.0;               /* 1px == 1 */
+                       else if(softrange > 32) fac= 1.0/2.0;   /* 2px == 1 */
+                       else                                    fac= 1.0/16.0;  /* 16px == 1? */
 
                        temp= data->startvalue + ((mx - data->dragstartx) * fac);
                        temp= ui_numedit_apply_snap(temp, softmin, softmax, snap);