diff options
Diffstat (limited to 'source/blender/editors/space_node/node_draw.cc')
-rw-r--r-- | source/blender/editors/space_node/node_draw.cc | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/source/blender/editors/space_node/node_draw.cc b/source/blender/editors/space_node/node_draw.cc index 7f0c426922b..d39304284ad 100644 --- a/source/blender/editors/space_node/node_draw.cc +++ b/source/blender/editors/space_node/node_draw.cc @@ -2574,20 +2574,14 @@ static void reroute_node_draw( if (node.label[0] != '\0') { /* draw title (node label) */ BLI_strncpy(showname, node.label, sizeof(showname)); - uiDefBut(&block, - UI_BTYPE_LABEL, - 0, - showname, - (int)(rct.xmin - NODE_DYS), - (int)(rct.ymax), - (short)512, - (short)NODE_DY, - nullptr, - 0, - 0, - 0, - 0, - nullptr); + const short width = 512; + const int x = BLI_rctf_cent_x(&node.totr) - (width / 2); + const int y = node.totr.ymax; + + uiBut *label_but = uiDefBut( + &block, UI_BTYPE_LABEL, 0, showname, x, y, width, (short)NODE_DY, NULL, 0, 0, 0, 0, NULL); + + UI_but_drawflag_disable(label_but, UI_BUT_TEXT_LEFT); } /* only draw input socket. as they all are placed on the same position. |