diff options
author | Joshua Leung <aligorith@gmail.com> | 2011-02-17 04:24:52 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2011-02-17 04:24:52 +0300 |
commit | f7295ad6d9653d31ce7aea2327c26aba893eb02c (patch) | |
tree | b9ffc0a3783898d0baf9fae73c199a81789a2e8f /source/blender | |
parent | 2c4fb98522d152c7ec8e973a72bdbacff95158a3 (diff) |
Bugfix: "Tweaking" Markers was working incorrectly
WM_modal_tweak_exit() was making incorrect use of the user-pref option
"Release Confirms Transform", indicated by confused coder comment
(<quote>"XXX: WTH is this?"</quote>).
This manisfested when moving markers by just click-dragging and
existing marker, and having it "drop" whereever the mouse was released
regardless of the user-pref option. This was quite confusing as it was
inconsistent with the way that all other transforms worked when this
option is off, where you would usually start the transform (click-
drag), release the button, move around a bit, and then finally click
to end.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 3de7b569af4..af78e7113f7 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -2099,21 +2099,29 @@ void WM_event_add_mousemove(bContext *C) /* for modal callbacks, check configuration for how to interpret exit with tweaks */ int WM_modal_tweak_exit(wmEvent *evt, int tweak_event) { - /* user preset or keymap? dunno... */ - // XXX WTH is this? - int tweak_modal= (U.flag & USER_RELEASECONFIRM)==0; - - switch(tweak_event) { - case EVT_TWEAK_L: - case EVT_TWEAK_M: - case EVT_TWEAK_R: - if(evt->val==tweak_modal) - return 1; - default: - /* this case is when modal callcback didnt get started with a tweak */ - if(evt->val) - return 1; + /* if the release-confirm userpref setting is enabled, + * tweak events can be cancelled when mouse is released + */ + if (U.flag & USER_RELEASECONFIRM) { + /* option on, so can exit with km-release */ + if (evt->val == KM_RELEASE) { + switch (tweak_event) { + case EVT_TWEAK_L: + case EVT_TWEAK_M: + case EVT_TWEAK_R: + return 1; + } + } } + else { + /* this is fine as long as not doing km-release, otherwise + * some items (i.e. markers) being tweaked may end up getting + * dropped all over + */ + if (evt->val != KM_RELEASE) + return 1; + } + return 0; } |