[Bf-blender-cvs] [7c2fb00e661] master: Cleanup: Remove unnecessary runtime rectangle from nodes in DNA

Hans Goudey noreply at git.blender.org
Fri Dec 10 20:52:10 CET 2021


Commit: 7c2fb00e661e080f0d0c85df60f1dff481c91d5e
Author: Hans Goudey
Date:   Fri Dec 10 13:52:02 2021 -0600
Branches: master
https://developer.blender.org/rB7c2fb00e661e080f0d0c85df60f1dff481c91d5e

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.

===================================================================

M	source/blender/editors/space_node/node_draw.cc
M	source/blender/makesdna/DNA_node_types.h

===================================================================

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;
   /**



More information about the Bf-blender-cvs mailing list