Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2021-12-06 00:45:41 +0300
committerHans Goudey <h.goudey@me.com>2021-12-06 00:45:41 +0300
commit338c1060d5d7b6a8bd3ec5632f543738de4c103c (patch)
treeb8ca72de9e4381dca31f681e604c2469e3a5a74e /source/blender/editors/space_node/node_intern.hh
parent0578921063fbb081239439062215f2538a31af4b (diff)
Cleanup: Remove unnecessary node type callbacks for drawing
Currently there are a few callbacks on `bNodeType` that do the same thing for every node type except reroutes and frame nodes. Having a callback for basic things complicates code and makes it harder to understand, and reroutes and frames are special cases in larger way. Arguably frame nodes shouldn't even be drawn like regular nodes, given that it adds a case of O(N^2) looping through all nodes. "Unrolling" the callbacks makes it easier to see what's happening, and therefore easier to optimize. Differential Revision: https://developer.blender.org/D13463
Diffstat (limited to 'source/blender/editors/space_node/node_intern.hh')
-rw-r--r--source/blender/editors/space_node/node_intern.hh12
1 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/editors/space_node/node_intern.hh b/source/blender/editors/space_node/node_intern.hh
index 91cf2fb33a5..980611cc909 100644
--- a/source/blender/editors/space_node/node_intern.hh
+++ b/source/blender/editors/space_node/node_intern.hh
@@ -80,6 +80,15 @@ struct SpaceNode_Runtime {
struct NodeInsertOfsData *iofsd;
};
+enum NodeResizeDirection {
+ NODE_RESIZE_NONE = 0,
+ NODE_RESIZE_TOP = (1 << 0),
+ NODE_RESIZE_BOTTOM = (1 << 1),
+ NODE_RESIZE_RIGHT = (1 << 2),
+ NODE_RESIZE_LEFT = (1 << 3),
+};
+ENUM_OPERATORS(NodeResizeDirection, NODE_RESIZE_LEFT);
+
/* Transform between View2Ds in the tree path. */
blender::float2 space_node_group_offset(const SpaceNode &snode);
@@ -106,8 +115,7 @@ void node_draw_sockets(const View2D &v2d,
bNode &node,
const bool draw_outputs,
const bool select_all);
-void node_update_default(const bContext *C, bNodeTree *ntree, bNode *node);
-int node_select_area_default(bNode *node, int x, int y);
+NodeResizeDirection node_get_resize_direction(const bNode *node, const int x, const int y);
int node_tweak_area_default(bNode *node, int x, int y);
void node_socket_color_get(const bContext &C,
const bNodeTree &ntree,