Transform numeric input: increment initialize input if needed.
authorMartin Poirier <theeth@yahoo.com>
Fri, 22 Jan 2010 02:50:40 +0000 (02:50 +0000)
committerMartin Poirier <theeth@yahoo.com>
Fri, 22 Jan 2010 02:50:40 +0000 (02:50 +0000)
Reported by Aligorith on irc

source/blender/editors/transform/transform_numinput.c

index e1e86af8a12acb79b17d955548468fb049f350f2..cfcf43d69bc5ca14d1b8b3a7c241d534af985a32 100644 (file)
@@ -166,11 +166,17 @@ char handleNumInput(NumInput *n, wmEvent *event, float increment)
 
        switch (event->type) {
     case DOWNARROWKEY: /* Increments down*/
-         n->val[idx] -= increment;
-         break;
+               if (!n->ctrl[idx])
+                       n->ctrl[idx] = 1;
+
+        n->val[idx] -= increment;
+        break;
     case UPARROWKEY: /* Increments up*/
-         n->val[idx] += increment;
-         break;
+               if (!n->ctrl[idx])
+                       n->ctrl[idx] = 1;
+
+               n->val[idx] += increment;
+        break;
        case BACKSPACEKEY:
                if (n->ctrl[idx] == 0) {
                        n->val[0]               =