From 58e2ebea3519c854b25c858ef01892df320ab1c4 Mon Sep 17 00:00:00 2001 From: Leon Schittek Date: Fri, 24 Mar 2023 12:21:40 +0100 Subject: [PATCH] Fix #106097: Don't offset child nodes when pasting Nodes inside of frames where pasted with an offset from the cursor. Since the location of nodes is in parent space, child nodes don't need to be offset separately. --- source/blender/editors/space_node/clipboard.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/space_node/clipboard.cc b/source/blender/editors/space_node/clipboard.cc index 95c1c25e343..177d3a45c4b 100644 --- a/source/blender/editors/space_node/clipboard.cc +++ b/source/blender/editors/space_node/clipboard.cc @@ -263,8 +263,11 @@ static int node_clipboard_paste_exec(bContext *C, wmOperator *op) const float2 offset = (mouse_location - center) / UI_DPI_FAC; for (bNode *new_node : node_map.values()) { - new_node->locx += offset.x; - new_node->locy += offset.y; + /* Skip the offset for parented nodes since the location is in parent space. */ + if (new_node->parent == nullptr) { + new_node->locx += offset.x; + new_node->locy += offset.y; + } } } -- 2.30.2