Fix #114623: Node group asset added with wrong position from header

We need to make sure the operator is invoked from the main
region, not the header region which gives the wrong location.

Pull Request: https://projects.blender.org/blender/blender/pulls/114789
This commit is contained in:
Hans Goudey
2023-11-13 12:49:42 +01:00
committed by Hans Goudey
parent e10ac17fdb
commit 5b094ee770

View File

@@ -187,7 +187,7 @@ static void node_add_catalog_assets_draw(const bContext *C, Menu *menu)
IFACE_(asset->get_name().c_str()),
ICON_NONE,
nullptr,
WM_OP_INVOKE_DEFAULT,
WM_OP_INVOKE_REGION_WIN,
UI_ITEM_NONE,
&op_ptr);
asset::operator_asset_reference_props_set(*asset, op_ptr);
@@ -234,7 +234,7 @@ static void node_add_unassigned_assets_draw(const bContext *C, Menu *menu)
IFACE_(asset->get_name().c_str()),
ICON_NONE,
nullptr,
WM_OP_INVOKE_DEFAULT,
WM_OP_INVOKE_REGION_WIN,
UI_ITEM_NONE,
&op_ptr);
asset::operator_asset_reference_props_set(*asset, op_ptr);