diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-07-12 18:41:52 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-07-12 18:41:52 +0400 |
commit | 126024e537a8d1f7c412abf62be3d5b8e243a7da (patch) | |
tree | 0f100dab7bc9bffe5210d7958994ad13eb9180a5 /source/blender | |
parent | 8ef23c6743ce00176754597f60ae549093ab6339 (diff) |
Fix #31584: Fractional step in value input for Skin Modifier (Event/input problem)
Issue was caused by the code which checked whether snapping should be enabled
on transform init taking into account keymap and special keys state. It was
used for Ctrl-Click on manipulator only.
Check for Ctrl state gave wring result with skin modifier. It was solved
by additional check for which mode transformation is initializing for --
currently manipulator is available for translation/roation/resize only
which doesn't give any keymap issues.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/transform/transform.c | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 1e9ecdd0e52..b355e1ee436 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -1676,19 +1676,25 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int /* Stupid code to have Ctrl-Click on manipulator work ok */ if (event) { - 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 == OSKEY) && event->oskey) ) - { - t->modifiers |= MOD_SNAP_INVERT; + /* do this only for translation/rotation/resize due to only this + * moded are available from manipulator and doing such check could + * lead to keymap conflicts for other modes (see #31584) + */ + if (ELEM3(mode, TFM_TRANSLATION, TFM_ROTATION, TFM_RESIZE)) { + 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 == OSKEY) && event->oskey) ) + { + t->modifiers |= MOD_SNAP_INVERT; + } + break; } - break; } } |