Browse Source

Fixes wrong position when adding node in VS editor

When adding a node in the visual script editor while zoomed in, the position of the newly added node would be wrong.
codecustard 5 years ago
parent
commit
601d870ae9
1 changed files with 1 additions and 0 deletions
  1. 1 0
      modules/visual_script/visual_script_editor.cpp

+ 1 - 0
modules/visual_script/visual_script_editor.cpp

@@ -3464,6 +3464,7 @@ void VisualScriptEditor::_selected_connect_node(const String &p_text, const Stri
 		ofs = ofs.snapped(Vector2(snap, snap));
 		ofs = ofs.snapped(Vector2(snap, snap));
 	}
 	}
 	ofs /= EDSCALE;
 	ofs /= EDSCALE;
+	ofs /= graph->get_zoom();
 
 
 	Set<int> vn;
 	Set<int> vn;