[Bf-blender-cvs] [d5e65790ec2] temp-T97352-3d-texturing-seam-bleeding-b2: Fix: Make node position consistent when added through link drag search
Leon Schittek
noreply at git.blender.org
Tue Sep 20 10:32:14 CEST 2022
Commit: d5e65790ec24667d89d28e686ba739bcfd135892
Author: Leon Schittek
Date: Sun Sep 18 20:18:50 2022 +0200
Branches: temp-T97352-3d-texturing-seam-bleeding-b2
https://developer.blender.org/rBd5e65790ec24667d89d28e686ba739bcfd135892
Fix: Make node position consistent when added through link drag search
The node position is specified in the coordinate space of the node
editor. The cursor position has to be divided by `UI_DPI_FAC` since it's
in view space but the offset is independent of any ui scaling.
Reviewed By: Hans Goudey
Differential Revision: http://developer.blender.org/D16006
===================================================================
M source/blender/editors/space_node/link_drag_search.cc
===================================================================
diff --git a/source/blender/editors/space_node/link_drag_search.cc b/source/blender/editors/space_node/link_drag_search.cc
index f1387da97b5..03bd0b5b36a 100644
--- a/source/blender/editors/space_node/link_drag_search.cc
+++ b/source/blender/editors/space_node/link_drag_search.cc
@@ -214,7 +214,7 @@ static void link_drag_search_exec_fn(bContext *C, void *arg1, void *arg2)
bNode *new_node = new_nodes.first();
new_node->locx = storage.cursor.x / UI_DPI_FAC;
- new_node->locy = storage.cursor.y / UI_DPI_FAC + 20 * UI_DPI_FAC;
+ new_node->locy = storage.cursor.y / UI_DPI_FAC + 20;
if (storage.in_out() == SOCK_IN) {
new_node->locx -= new_node->width;
}
More information about the Bf-blender-cvs
mailing list