From aa8fda324bfb8b224810441b4e98d625cbfda3ad Mon Sep 17 00:00:00 2001 From: Monique Dewanchand Date: Tue, 22 Jan 2013 21:35:33 +0000 Subject: [PATCH] Displaying labelname with reroute nodes. It uses the default text color. --- source/blender/editors/space_node/drawnode.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 981a1775b51..ffc780ebf69 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -1121,8 +1121,10 @@ static void node_update_reroute(const bContext *UNUSED(C), bNodeTree *UNUSED(ntr static void node_draw_reroute(const bContext *C, ARegion *ar, SpaceNode *UNUSED(snode), bNodeTree *ntree, bNode *node) { bNodeSocket *sock; -#if 0 /* UNUSED */ + char showname[128]; /* 128 used below */ rctf *rct = &node->totr; + +#if 0 /* UNUSED */ float size = NODE_REROUTE_SIZE; #endif float socket_size = NODE_SOCKSIZE; @@ -1163,6 +1165,15 @@ static void node_draw_reroute(const bContext *C, ARegion *ar, SpaceNode *UNUSED( } #endif + if (node->label[0] != '\0') { + /* draw title (node label) */ + BLI_strncpy(showname, node->label, sizeof(showname)); + uiDefBut(node->block, LABEL, 0, showname, + (int)(rct->xmin-NODE_DYS), (int)(rct->ymax), + (short)512, (short)NODE_DY, + NULL, 0, 0, 0, 0, ""); + } + /* only draw input socket. as they all are placed on the same position. * highlight also if node itself is selected, since we don't display the node body separately! */