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-11-19 23:36:32 +0300
committerHans Goudey <h.goudey@me.com>2021-11-19 23:36:32 +0300
commit51a7961e0984468e8ee6e5f9313e3884ba46d69d (patch)
tree103ea126fa0d98ba9fb389595b3180183da1f44c /source/blender/editors/space_node/node_intern.hh
parentc3fed4d463f07b8bfcecf98ed91256cf4e561e81 (diff)
Cleanup: Simplify node editor link dragging storage
Now that `node_intern.hh` is a C++ header, we can use C++ types there. This patch replaces the linked list of dragged links with a vector. Also, the list of drag operator custom data, `nldrag`, doesn't seem to need to be a list at all, so I just made it a unique pointer. Differential Revision: https://developer.blender.org/D13252
Diffstat (limited to 'source/blender/editors/space_node/node_intern.hh')
-rw-r--r--source/blender/editors/space_node/node_intern.hh11
1 files changed, 3 insertions, 8 deletions
diff --git a/source/blender/editors/space_node/node_intern.hh b/source/blender/editors/space_node/node_intern.hh
index 436df70429b..2e973def867 100644
--- a/source/blender/editors/space_node/node_intern.hh
+++ b/source/blender/editors/space_node/node_intern.hh
@@ -49,13 +49,8 @@ struct wmWindow;
/* temp data to pass on to modal */
struct bNodeLinkDrag {
- struct bNodeLinkDrag *next, *prev;
-
- /* List of links dragged by the operator.
- * NOTE: This is a list of LinkData structs on top of the actual bNodeLinks.
- * This way the links can be added to the node tree while being stored in this list.
- */
- ListBase links;
+ /** Links dragged by the operator. */
+ blender::Vector<bNodeLink *> links;
bool from_multi_input_socket;
int in_out;
@@ -80,7 +75,7 @@ struct SpaceNode_Runtime {
bool recalc;
/** Temporary data for modal linking operator. */
- struct ListBase linkdrag;
+ std::unique_ptr<bNodeLinkDrag> linkdrag;
/* XXX hack for translate_attach op-macros to pass data from transform op to insert_offset op */
/** Temporary data for node insert offset (in UI called Auto-offset). */