diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-05-28 06:26:50 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-05-28 06:36:43 +0300 |
commit | 2e22cfd08a0d589e8894e322ed29d5c3227ca04d (patch) | |
tree | 1dea3f566ce6ee8bdefaa5ca78cec1844662d2b8 /source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c | |
parent | 219e6a98c66a00673395d5c420ff35ad86eef846 (diff) |
Gizmo: changes to internal drag logic
Minor changes to recent gizmo click/drag logic 08dff7b40bc6a
Changing the gizmos highlighted part in the invoke_prepare
callback is too error prone since it needs to run
before it's known which operator will execute.
Add back 'drag_part', since it simplifies click-drag use.
While this isn't essential with custom keymaps per gizmo
it avoids having to define a keymap in the case a drag
event needs a different action.
Diffstat (limited to 'source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c')
-rw-r--r-- | source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c b/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c index 688173f1771..56de2202731 100644 --- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c +++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c @@ -1017,6 +1017,11 @@ void wm_gizmomap_modal_set( WM_tooltip_clear(C, win); + /* Use even if we don't have invoke, so we can setup data before an operator runs. */ + if (gz->parent_gzgroup->type->invoke_prepare) { + gz->parent_gzgroup->type->invoke_prepare(C, gz->parent_gzgroup, gz, event); + } + if (gz->type->invoke && (gz->type->modal || gz->custom_modal)) { const int retval = gz->type->invoke(C, gz, event); if ((retval & OPERATOR_RUNNING_MODAL) == 0) { |