diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2021-02-09 18:28:51 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2021-02-09 18:29:00 +0300 |
commit | b926c9f34587651b6c39dc43608a79dd6367e9a8 (patch) | |
tree | 9c171b98b5a79c2b2790ed981847d171d0d43e7c /source/blender/editors/transform/transform.c | |
parent | e44b2ada3e4ad1a5f89f5effd5bf493fd30fc6f2 (diff) |
Transform: Expose the hardcoded Precision Key
As shown on the T85383, attempts are made to edit the precision mode key.
But that key was hardcoded.
That key now appears among the custom modal keymap items.
Diffstat (limited to 'source/blender/editors/transform/transform.c')
-rw-r--r-- | source/blender/editors/transform/transform.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index d46cdb62f30..2fbcbe22349 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -695,6 +695,7 @@ wmKeyMap *transform_modal_keymap(wmKeyConfig *keyconf) {TFM_MODAL_RESIZE, "RESIZE", 0, "Resize", ""}, {TFM_MODAL_AUTOCONSTRAINT, "AUTOCONSTRAIN", 0, "Automatic Constraint", ""}, {TFM_MODAL_AUTOCONSTRAINTPLANE, "AUTOCONSTRAINPLANE", 0, "Automatic Constraint Plane", ""}, + {TFM_MODAL_PRECISION, "PRECISION", 0, "Precision Mode", ""}, {0, NULL, 0, NULL, NULL}, }; @@ -806,8 +807,6 @@ int transformEvent(TransInfo *t, const wmEvent *event) const int modifiers_prev = t->modifiers; const int mode_prev = t->mode; - t->redraw |= handleMouseInput(t, &t->mouse, event); - /* Handle modal numinput events first, if already activated. */ if (((event->val == KM_PRESS) || (event->type == EVT_MODAL_MAP)) && hasNumInput(&t->num) && handleNumInput(t->context, &(t->num), event)) { @@ -1095,6 +1094,19 @@ int transformEvent(TransInfo *t, const wmEvent *event) handled = true; } break; + case TFM_MODAL_PRECISION: + if (event->prevval == KM_PRESS) { + t->modifiers |= MOD_PRECISION; + /* Shift is modifier for higher precision transform. */ + t->mouse.precision = 1; + t->redraw |= TREDRAW_HARD; + } + else if (event->prevval == KM_RELEASE) { + t->modifiers &= ~MOD_PRECISION; + t->mouse.precision = 0; + t->redraw |= TREDRAW_HARD; + } + break; /* Those two are only handled in transform's own handler, see T44634! */ case TFM_MODAL_EDGESLIDE_UP: case TFM_MODAL_EDGESLIDE_DOWN: |