diff options
author | Hans Goudey <h.goudey@me.com> | 2021-12-11 18:51:53 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-12-11 18:51:53 +0300 |
commit | 23be5fd4499ad92c049f140564df3e32cfe9cea3 (patch) | |
tree | 6210af745bb492331c2d3ca5aa500bf16447592a /source/blender/editors/space_node/node_draw.cc | |
parent | 96387a2eff97709f519274aa510942c5eec6b493 (diff) |
Cleanup: Use const arguments
Also remove unnecessary function to set a node type's
label function that duplicated its definition, and make
another function static.
Diffstat (limited to 'source/blender/editors/space_node/node_draw.cc')
-rw-r--r-- | source/blender/editors/space_node/node_draw.cc | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/source/blender/editors/space_node/node_draw.cc b/source/blender/editors/space_node/node_draw.cc index 77fccdaf910..5990462191e 100644 --- a/source/blender/editors/space_node/node_draw.cc +++ b/source/blender/editors/space_node/node_draw.cc @@ -651,7 +651,7 @@ static void node_update_hidden(bNode &node) node.totr.ymax); } -int node_get_colorid(bNode &node) +static int node_get_colorid(const bNode &node) { switch (node.typeinfo->nclass) { case NODE_CLASS_INPUT: @@ -1502,8 +1502,10 @@ static char *node_errors_tooltip_fn(bContext *UNUSED(C), void *argN, const char #define NODE_HEADER_ICON_SIZE (0.8f * U.widget_unit) -static void node_add_error_message_button( - const bContext &C, bNodeTree &UNUSED(ntree), bNode &node, const rctf &rect, float &icon_offset) +static void node_add_error_message_button(const bContext &C, + bNode &node, + const rctf &rect, + float &icon_offset) { SpaceNode *snode = CTX_wm_space_node(&C); const geo_log::NodeLog *node_log = geo_log::ModifierLog::find_node_by_node_editor_context(*snode, @@ -1902,7 +1904,7 @@ static void node_draw_basis(const bContext &C, UI_block_emboss_set(node.block, UI_EMBOSS); } - node_add_error_message_button(C, ntree, node, rct, iconofs); + node_add_error_message_button(C, node, rct, iconofs); /* Title. */ if (node.flag & SELECT) { @@ -2420,12 +2422,14 @@ void node_update_nodetree(const bContext &C, bNodeTree &ntree) } } -static void frame_node_draw_label(bNodeTree &ntree, bNode &node, const SpaceNode &snode) +static void frame_node_draw_label(const bNodeTree &ntree, + const bNode &node, + const SpaceNode &snode) { const float aspect = snode.runtime->aspect; /* XXX font id is crap design */ const int fontid = UI_style_get()->widgetlabel.uifont_id; - NodeFrame *data = (NodeFrame *)node.storage; + const NodeFrame *data = (const NodeFrame *)node.storage; const float font_size = data->label_size / aspect; char label[MAX_NAME]; @@ -2462,7 +2466,7 @@ static void frame_node_draw_label(bNodeTree &ntree, bNode &node, const SpaceNode /* draw text body */ if (node.id) { - Text *text = (Text *)node.id; + const Text *text = (const Text *)node.id; const int line_height_max = BLF_height_max(fontid); const float line_spacing = (line_height_max * aspect); const float line_width = (BLI_rctf_size_x(&rct) - margin) / aspect; @@ -2484,7 +2488,7 @@ static void frame_node_draw_label(bNodeTree &ntree, bNode &node, const SpaceNode BLF_wordwrap(fontid, line_width); - LISTBASE_FOREACH (TextLine *, line, &text->lines) { + LISTBASE_FOREACH (const TextLine *, line, &text->lines) { struct ResultBLF info; if (line->line[0]) { BLF_position(fontid, x, y, 0); |