Fix T72416: Tool settings ignored when activated from gizmo

This commit is contained in:
2019-12-17 14:55:41 +11:00
parent 2564e2a2ad
commit aa1af7f8e4
2 changed files with 14 additions and 3 deletions

View File

@@ -109,6 +109,8 @@ static wmGizmo *tool_generic_create_gizmo(const bContext *C, wmGizmoGroup *gzgro
RNA_float_set(gz->ptr, "backdrop_fill_alpha", 0.125f);
}
gz->flag |= WM_GIZMO_OPERATOR_TOOL_INIT;
bToolRef *tref = WM_toolsystem_ref_from_context((bContext *)C);
wmWindowManager *wm = CTX_wm_manager(C);
struct wmKeyConfig *kc = wm->defaultconf;

View File

@@ -2265,9 +2265,18 @@ static int wm_handler_operator_call(bContext *C,
bool use_last_properties = true;
PointerRNA tool_properties = {0};
bToolRef *keymap_tool = ((handler_base->type == WM_HANDLER_TYPE_KEYMAP) ?
((wmEventHandler_Keymap *)handler_base)->keymap_tool :
NULL);
bToolRef *keymap_tool = NULL;
if (handler_base->type == WM_HANDLER_TYPE_KEYMAP) {
keymap_tool = ((wmEventHandler_Keymap *)handler_base)->keymap_tool;
}
else if (handler_base->type == WM_HANDLER_TYPE_GIZMO) {
wmGizmoMap *gizmo_map = ((wmEventHandler_Gizmo *)handler_base)->gizmo_map;
wmGizmo *gz = wm_gizmomap_highlight_get(gizmo_map);
if (gz && (gz->flag & WM_GIZMO_OPERATOR_TOOL_INIT)) {
keymap_tool = WM_toolsystem_ref_from_context(C);
}
}
const bool is_tool = (keymap_tool != NULL);
const bool use_tool_properties = is_tool;