Fix: Display color sockets without labels correctly

Don't build a manual property split layout when the label
for the socket is hidden.
This commit is contained in:
Hans Goudey 2021-10-19 14:04:03 -05:00
parent fccc530003
commit 85c8dd6c96
1 changed files with 8 additions and 3 deletions

View File

@ -3577,9 +3577,14 @@ static void std_node_socket_draw(
}
break;
case SOCK_RGBA: {
uiLayout *row = uiLayoutSplit(layout, 0.4f, false);
uiItemL(row, text, 0);
uiItemR(row, ptr, "default_value", DEFAULT_FLAGS, "", 0);
if (text[0] == '\0') {
uiItemR(layout, ptr, "default_value", DEFAULT_FLAGS, "", 0);
}
else {
uiLayout *row = uiLayoutSplit(layout, 0.4f, false);
uiItemL(row, text, 0);
uiItemR(row, ptr, "default_value", DEFAULT_FLAGS, "", 0);
}
break;
}
case SOCK_STRING: {