diff options
author | Hans Goudey <h.goudey@me.com> | 2021-10-19 22:04:03 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-10-19 22:04:03 +0300 |
commit | 85c8dd6c968334fc8c58a1f4ba1b145996510120 (patch) | |
tree | b04ace9c2a838697e29cf5eb69fc8e7ece3e245c | |
parent | fccc530003be62bcfafc15ed73aa01bbf443af52 (diff) |
Fix: Display color sockets without labels correctly
Don't build a manual property split layout when the label
for the socket is hidden.
-rw-r--r-- | source/blender/editors/space_node/drawnode.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/editors/space_node/drawnode.cc b/source/blender/editors/space_node/drawnode.cc index f7231df85a0..afe36922b09 100644 --- a/source/blender/editors/space_node/drawnode.cc +++ b/source/blender/editors/space_node/drawnode.cc @@ -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: { |