1
1

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
This commit is contained in:
2022-09-18 20:18:50 +02:00
parent fd1bc90679
commit 998ffcbf09

View File

@@ -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;
}