From 9ba1ff1c6322cbacaaf7fad057cc507673dcd92d Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Mon, 8 Mar 2021 13:38:42 +0100 Subject: Fix T86373: crash picking colors in geometry nodesockets Caused by {rB85421c4fab02}. Above commit treated `SOCK_RGBA` and `SOCK_STRING` the same in `std_node_socket_draw`. That would turn a RGBA button into a text button (for attribute search), leading to trouble. Note these were just treated the same prior to above commit because both were doing the layout split. Now just give RGBA sockets their own case. Maniphest Tasks: T86373 Differential Revision: https://developer.blender.org/D10646 --- source/blender/editors/space_node/drawnode.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source/blender/editors/space_node/drawnode.c') diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 977c2053187..a9a7ef5a0a2 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -3385,7 +3385,12 @@ static void std_node_socket_draw( } } break; - case SOCK_RGBA: + case SOCK_RGBA: { + uiLayout *row = uiLayoutSplit(layout, 0.5f, false); + uiItemL(row, text, 0); + uiItemR(row, ptr, "default_value", DEFAULT_FLAGS, "", 0); + break; + } case SOCK_STRING: { uiLayout *row = uiLayoutSplit(layout, 0.5f, false); uiItemL(row, text, 0); -- cgit v1.2.3