Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Poirier <theeth@yahoo.com>2010-01-22 01:20:49 +0300
committerMartin Poirier <theeth@yahoo.com>2010-01-22 01:20:49 +0300
commit52858b7e66000b2784f6ff92d6e3d90d1038c8b9 (patch)
tree2455fb897c3694640b8284cbd2fa64cd72ce8c96
parentb400703403dd87c482824a1b10f40923c67412e4 (diff)
[#20700] Transformation Increments
Patch by Jonathan Smith When using numerical input, up and down arrow keys increment and decrement the value by the transform increment amount (grid for grab and so on).
-rw-r--r--source/blender/editors/transform/transform.c2
-rw-r--r--source/blender/editors/transform/transform.h2
-rw-r--r--source/blender/editors/transform/transform_numinput.c10
3 files changed, 10 insertions, 4 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index 5e833708751..864c816a8f4 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -954,7 +954,7 @@ int transformEvent(TransInfo *t, wmEvent *event)
}
// Numerical input events
- t->redraw |= handleNumInput(&(t->num), event);
+ t->redraw |= handleNumInput(&(t->num), event, t->snap[1]);
// NDof input events
switch(handleNDofInput(&(t->ndof), event))
diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h
index fd4f67f4f27..aae317fe5c1 100644
--- a/source/blender/editors/transform/transform.h
+++ b/source/blender/editors/transform/transform.h
@@ -677,7 +677,7 @@ void initNumInput(NumInput *n);
void outputNumInput(NumInput *n, char *str);
short hasNumInput(NumInput *n);
void applyNumInput(NumInput *n, float *vec);
-char handleNumInput(NumInput *n, struct wmEvent *event);
+char handleNumInput(NumInput *n, struct wmEvent *event, float increment);
/*********************** NDofInput ********************************/
diff --git a/source/blender/editors/transform/transform_numinput.c b/source/blender/editors/transform/transform_numinput.c
index f5f1d5fac9e..e1e86af8a12 100644
--- a/source/blender/editors/transform/transform_numinput.c
+++ b/source/blender/editors/transform/transform_numinput.c
@@ -22,7 +22,7 @@
*
* The Original Code is: all of this file.
*
- * Contributor(s): none yet.
+ * Contributor(s): Jonathan Smith
*
* ***** END GPL LICENSE BLOCK *****
*/
@@ -159,12 +159,18 @@ void applyNumInput(NumInput *n, float *vec)
}
}
-char handleNumInput(NumInput *n, wmEvent *event)
+char handleNumInput(NumInput *n, wmEvent *event, float increment)
{
float Val = 0;
short idx = n->idx, idx_max = n->idx_max;
switch (event->type) {
+ case DOWNARROWKEY: /* Increments down*/
+ n->val[idx] -= increment;
+ break;
+ case UPARROWKEY: /* Increments up*/
+ n->val[idx] += increment;
+ break;
case BACKSPACEKEY:
if (n->ctrl[idx] == 0) {
n->val[0] =