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:
authorLeon Schittek <leon.schittek@gmx.net>2022-09-18 21:18:50 +0300
committerLeon Schittek <leon.schittek@gmx.net>2022-09-18 21:18:50 +0300
commit998ffcbf096eb1f2dd04ac8c762db1f6074a1c8a (patch)
tree80b8a7073ce8da86767133af0bd7d9d77ff8436e /source/blender/editors/space_node
parentfd1bc90679a89a29172683939827be9c565e2217 (diff)
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
Diffstat (limited to 'source/blender/editors/space_node')
-rw-r--r--source/blender/editors/space_node/link_drag_search.cc2
1 files changed, 1 insertions, 1 deletions
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;
}