diff options
author | Martin Poirier <theeth@yahoo.com> | 2010-03-14 22:38:36 +0300 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2010-03-14 22:38:36 +0300 |
commit | cbe776655a3f5c402dc03b87fb815ed8be0a8af1 (patch) | |
tree | 9107777014f313f01f18d989e91da958793e9be9 /source/blender | |
parent | 9b660f3425d073b780361b56938b3385f6f6d7ce (diff) |
transform: Ctrl-Click on manipulators uses increments correctly.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/transform/transform.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 7d8ee677130..01aa41b0499 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -1502,6 +1502,27 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int return 0; } + /* Stupid code to have Ctrl-Click on manipulator work ok */ + { + wmKeyMap *keymap = WM_keymap_active(CTX_wm_manager(C), op->type->modalkeymap); + wmKeyMapItem *kmi; + + for (kmi = keymap->items.first; kmi; kmi = kmi->next) + { + if (kmi->propvalue == TFM_MODAL_SNAP_INV_ON && kmi->val == KM_PRESS) + { + if ((ELEM(kmi->type, LEFTCTRLKEY, RIGHTCTRLKEY) && event->ctrl) || + (ELEM(kmi->type, LEFTSHIFTKEY, RIGHTSHIFTKEY) && event->shift) || + (ELEM(kmi->type, LEFTALTKEY, RIGHTALTKEY) && event->alt) || + (kmi->type == COMMANDKEY && event->oskey)) { + t->modifiers |= MOD_SNAP_INVERT; + } + break; + } + } + + } + initSnapping(t, op); // Initialize snapping data AFTER mode flags /* EVIL! posemode code can switch translation to rotate when 1 bone is selected. will be removed (ton) */ |