From b6a0027de3a5ee039442f10cf7f9bc1bf3116733 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 27 May 2019 23:58:12 +1000 Subject: Gizmo: add event argument to invoke_prepare callback --- source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c | 2 +- source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c | 2 +- source/blender/windowmanager/gizmo/wm_gizmo_fn.h | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'source/blender/windowmanager/gizmo') diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c b/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c index 95cb86ef3cb..ded308f4b7b 100644 --- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c +++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c @@ -411,7 +411,7 @@ static bool gizmo_tweak_start_and_finish( } else { if (gz->parent_gzgroup->type->invoke_prepare) { - gz->parent_gzgroup->type->invoke_prepare(C, gz->parent_gzgroup, gz); + gz->parent_gzgroup->type->invoke_prepare(C, gz->parent_gzgroup, gz, event); } /* Allow for 'button' gizmos, single click to run an action. */ WM_gizmo_operator_invoke(C, gz, gzop); diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c b/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c index 1f29ffd5669..9c18406b84d 100644 --- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c +++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c @@ -1010,7 +1010,7 @@ void wm_gizmomap_modal_set( /* 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); + gz->parent_gzgroup->type->invoke_prepare(C, gz->parent_gzgroup, gz, event); } if (gz->type->invoke && (gz->type->modal || gz->custom_modal)) { diff --git a/source/blender/windowmanager/gizmo/wm_gizmo_fn.h b/source/blender/windowmanager/gizmo/wm_gizmo_fn.h index 2aada0f202a..242b0f6de80 100644 --- a/source/blender/windowmanager/gizmo/wm_gizmo_fn.h +++ b/source/blender/windowmanager/gizmo/wm_gizmo_fn.h @@ -33,7 +33,8 @@ typedef void (*wmGizmoGroupFnRefresh)(const struct bContext *, struct wmGizmoGro typedef void (*wmGizmoGroupFnDrawPrepare)(const struct bContext *, struct wmGizmoGroup *); typedef void (*wmGizmoGroupFnInvokePrepare)(const struct bContext *, struct wmGizmoGroup *, - struct wmGizmo *); + struct wmGizmo *, + const struct wmEvent *); typedef struct wmKeyMap *(*wmGizmoGroupFnSetupKeymap)(const struct wmGizmoGroupType *, struct wmKeyConfig *)ATTR_WARN_UNUSED_RESULT; typedef void (*wmGizmoGroupFnMsgBusSubscribe)(const struct bContext *, -- cgit v1.2.3