Fix #106097: Don't offset child nodes when pasting #106099
|
@ -263,10 +263,13 @@ static int node_clipboard_paste_exec(bContext *C, wmOperator *op)
|
||||||
const float2 offset = (mouse_location - center) / UI_DPI_FAC;
|
const float2 offset = (mouse_location - center) / UI_DPI_FAC;
|
||||||
|
|
||||||
for (bNode *new_node : node_map.values()) {
|
for (bNode *new_node : node_map.values()) {
|
||||||
|
/* 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->locx += offset.x;
|
||||||
new_node->locy += offset.y;
|
new_node->locy += offset.y;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Add links between existing nodes. */
|
/* Add links between existing nodes. */
|
||||||
for (const bNodeLink &link : clipboard.links) {
|
for (const bNodeLink &link : clipboard.links) {
|
||||||
|
|
Loading…
Reference in New Issue