diff --git a/source/blender/editors/space_node/node_edit.cc b/source/blender/editors/space_node/node_edit.cc index 683b180e2a4..533ea703449 100644 --- a/source/blender/editors/space_node/node_edit.cc +++ b/source/blender/editors/space_node/node_edit.cc @@ -1016,10 +1016,12 @@ wmKeyMap *node_resize_modal_keymap(wmKeyConfig *keyconf) return keymap; } -/* Compute the nearest 1D coordinate corresponding to the nearest grid in node. */ +/* Compute the nearest 1D coordinate corresponding to the nearest grid in node editors. */ static float nearest_node_grid_coord(float co) { - float grid_size = grid_size_get(); + /* Size and location of nodes are independent of UI scale, so grid size should be independent of + * UI scale as well. */ + float grid_size = grid_size_get() / UI_SCALE_FAC; float rest = fmod(co, grid_size); float offset = rest - grid_size / 2 >= 0 ? grid_size : 0;