From 7c2fb00e661e080f0d0c85df60f1dff481c91d5e Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Fri, 10 Dec 2021 13:52:02 -0600 Subject: [PATCH] Cleanup: Remove unnecessary runtime rectangle from nodes in DNA I assume this `butr` rectangle was used more in the past, but currently its value is set and used less than 10 lines apart, so it's trivial to remove 16 bytes from every node. The other rectangles are also runtime data and could be removed, but they are more difficult. --- source/blender/editors/space_node/node_draw.cc | 8 +------- source/blender/makesdna/DNA_node_types.h | 2 -- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/source/blender/editors/space_node/node_draw.cc b/source/blender/editors/space_node/node_draw.cc index 62b594d430b..77fccdaf910 100644 --- a/source/blender/editors/space_node/node_draw.cc +++ b/source/blender/editors/space_node/node_draw.cc @@ -480,18 +480,12 @@ static void node_update_basis(const bContext &C, bNodeTree &ntree, bNode &node) if (node.typeinfo->draw_buttons && (node.flag & NODE_OPTIONS)) { dy -= NODE_DYS / 2; - /* Set this for `uifunc()` that don't use layout engine yet. */ - node.butr.xmin = 0; - node.butr.xmax = NODE_WIDTH(node) - 2 * NODE_DYS; - node.butr.ymin = 0; - node.butr.ymax = 0; - uiLayout *layout = UI_block_layout(node.block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, loc.x + NODE_DYS, dy, - node.butr.xmax, + NODE_WIDTH(node) - NODE_DY, 0, 0, UI_style_get_dpi()); diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h index dfae303ccfb..b0ff10ebd1d 100644 --- a/source/blender/makesdna/DNA_node_types.h +++ b/source/blender/makesdna/DNA_node_types.h @@ -304,8 +304,6 @@ typedef struct bNode { /** Entire boundbox (world-space). */ rctf totr; - /** Optional buttons area. */ - rctf butr; /** Optional preview area. */ rctf prvr; /**