Explorar o código

Fix incorrect position of the created VisualShader nodes on zoomed graph

(cherry picked from commit 8249ae8085475a66ea121e9018ec52f0bf0c4eb6)
Yuri Roubinsky %!s(int64=4) %!d(string=hai) anos
pai
achega
9c9559654b
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      editor/plugins/visual_shader_editor_plugin.cpp

+ 1 - 0
editor/plugins/visual_shader_editor_plugin.cpp

@@ -1439,6 +1439,7 @@ VisualShaderNode *VisualShaderEditor::_add_node(int p_idx, int p_op_idx) {
 		position += graph->get_size() * 0.5;
 		position += graph->get_size() * 0.5;
 		position /= EDSCALE;
 		position /= EDSCALE;
 	}
 	}
+	position /= graph->get_zoom();
 	saved_node_pos_dirty = false;
 	saved_node_pos_dirty = false;
 
 
 	VisualShader::Type type = VisualShader::Type(edit_type->get_selected());
 	VisualShader::Type type = VisualShader::Type(edit_type->get_selected());