diff options
Diffstat (limited to 'source/blender/editors/space_node')
-rw-r--r-- | source/blender/editors/space_node/node_draw.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c index d2e189486df..5b91796d41c 100644 --- a/source/blender/editors/space_node/node_draw.c +++ b/source/blender/editors/space_node/node_draw.c @@ -758,10 +758,10 @@ void node_draw_shadow(SpaceNode *snode, bNode *node, float radius, float alpha) void node_draw_sockets(View2D *v2d, const bContext *C, bNodeTree *ntree, bNode *node, bool draw_outputs, bool select_all) { - const unsigned int total_input_ct = BLI_listbase_count(&node->inputs); - const unsigned int total_output_ct = BLI_listbase_count(&node->outputs); + const uint total_input_len = BLI_listbase_count(&node->inputs); + const uint total_output_len = BLI_listbase_count(&node->outputs); - if (total_input_ct + total_output_ct == 0) { + if (total_input_len + total_output_len == 0) { return; } @@ -788,17 +788,17 @@ void node_draw_sockets(View2D *v2d, const bContext *C, bNodeTree *ntree, bNode * immUniform1f("outlineWidth", 1.0f); immUniform4f("outlineColor", 0.0f, 0.0f, 0.0f, 0.6f); - immBeginAtMost(GWN_PRIM_POINTS, total_input_ct + total_output_ct); + immBeginAtMost(GWN_PRIM_POINTS, total_input_len + total_output_len); } /* socket inputs */ - short selected_input_ct = 0; + short selected_input_len = 0; bNodeSocket *sock; for (sock = node->inputs.first; sock; sock = sock->next) { if (nodeSocketIsHidden(sock)) continue; if (select_all || (sock->flag & SELECT)) { - ++selected_input_ct; + ++selected_input_len; continue; } @@ -806,13 +806,13 @@ void node_draw_sockets(View2D *v2d, const bContext *C, bNodeTree *ntree, bNode * } /* socket outputs */ - short selected_output_ct = 0; + short selected_output_len = 0; if (draw_outputs) { for (sock = node->outputs.first; sock; sock = sock->next) { if (nodeSocketIsHidden(sock)) continue; if (select_all || (sock->flag & SELECT)) { - ++selected_output_ct; + ++selected_output_len; continue; } @@ -825,36 +825,36 @@ void node_draw_sockets(View2D *v2d, const bContext *C, bNodeTree *ntree, bNode * } /* go back and draw selected sockets */ - if (selected_input_ct + selected_output_ct > 0) { + if (selected_input_len + selected_output_len > 0) { /* outline for selected sockets */ float c[3]; UI_GetThemeColor3fv(TH_TEXT_HI, c); immUniform4f("outlineColor", c[0], c[1], c[2], 1.0f); immUniform1f("outlineWidth", 1.5f); - immBegin(GWN_PRIM_POINTS, selected_input_ct + selected_output_ct); + immBegin(GWN_PRIM_POINTS, selected_input_len + selected_output_len); - if (selected_input_ct) { + if (selected_input_len) { /* socket inputs */ for (sock = node->inputs.first; sock; sock = sock->next) { if (nodeSocketIsHidden(sock)) continue; if (select_all || (sock->flag & SELECT)) { node_socket_circle_draw(C, ntree, node_ptr, sock, pos, col); - if (--selected_input_ct == 0) + if (--selected_input_len == 0) break; /* stop as soon as last one is drawn */ } } } - if (selected_output_ct) { + if (selected_output_len) { /* socket outputs */ for (sock = node->outputs.first; sock; sock = sock->next) { if (nodeSocketIsHidden(sock)) continue; if (select_all || (sock->flag & SELECT)) { node_socket_circle_draw(C, ntree, node_ptr, sock, pos, col); - if (--selected_output_ct == 0) + if (--selected_output_len == 0) break; /* stop as soon as last one is drawn */ } } |