[Bf-blender-cvs] [891fe70d7f0] master: Fix T103739: Nodes pasted at wrong position with UI scale
Leon Schittek
noreply at git.blender.org
Mon Jan 9 17:37:43 CET 2023
Commit: 891fe70d7f0a84573b94379d067f00fb0469b0c2
Author: Leon Schittek
Date: Mon Jan 9 11:37:27 2023 -0500
Branches: master
https://developer.blender.org/rB891fe70d7f0a84573b94379d067f00fb0469b0c2
Fix T103739: Nodes pasted at wrong position with UI scale
===================================================================
M source/blender/editors/space_node/clipboard.cc
===================================================================
diff --git a/source/blender/editors/space_node/clipboard.cc b/source/blender/editors/space_node/clipboard.cc
index beda081eec8..95c1c25e343 100644
--- a/source/blender/editors/space_node/clipboard.cc
+++ b/source/blender/editors/space_node/clipboard.cc
@@ -257,11 +257,10 @@ static int node_clipboard_paste_exec(bContext *C, wmOperator *op)
}
/* DPI factor needs to be removed when computing a View2D offset from drawing rects. */
center /= clipboard.nodes.size();
- center /= UI_DPI_FAC;
float2 mouse_location;
RNA_property_float_get_array(op->ptr, offset_prop, mouse_location);
- const float2 offset = mouse_location - center;
+ const float2 offset = (mouse_location - center) / UI_DPI_FAC;
for (bNode *new_node : node_map.values()) {
new_node->locx += offset.x;
More information about the Bf-blender-cvs
mailing list