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:
-rw-r--r--source/blender/editors/space_node/node_add.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/editors/space_node/node_add.cc b/source/blender/editors/space_node/node_add.cc
index 943fc99a7f6..07eecff320a 100644
--- a/source/blender/editors/space_node/node_add.cc
+++ b/source/blender/editors/space_node/node_add.cc
@@ -194,15 +194,16 @@ static int add_reroute_exec(bContext *C, wmOperator *op)
}
/* Place the new reroute at the average location of all connected cuts. */
- const float2 loc = std::accumulate(cuts.values().begin(), cuts.values().end(), float2(0)) /
- cuts.size() / UI_DPI_FAC;
- reroute->locx = loc.x;
- reroute->locy = loc.y;
+ const float2 insert_point = std::accumulate(
+ cuts.values().begin(), cuts.values().end(), float2(0)) /
+ cuts.size();
+ reroute->locx = insert_point.x / UI_DPI_FAC;
+ reroute->locy = insert_point.y / UI_DPI_FAC;
/* Attach the reroute node to frame nodes behind it. */
for (const int i : frame_nodes.index_range()) {
bNode *frame_node = frame_nodes.last(i);
- if (BLI_rctf_isect_pt_v(&frame_node->totr, loc)) {
+ if (BLI_rctf_isect_pt_v(&frame_node->totr, insert_point)) {
nodeAttachNode(reroute, frame_node);
break;
}