summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-08-11 10:19:21 +0200
committerGitHub <noreply@github.com>2021-08-11 10:19:21 +0200
commite81427e9590cff1b74dac44dda288bd8f4730238 (patch)
tree2c776f93da4240e309ebde48826c0e57d80ea21d
parent80dec1948a291543e5d7a19d611b8d290144eb50 (diff)
parent8249ae8085475a66ea121e9018ec52f0bf0c4eb6 (diff)
Merge pull request #51497 from Chaosus/vs_fix_addnode_zoomed
Fix incorrect position of the created VisualShader nodes on zoomed graph
-rw-r--r--editor/plugins/visual_shader_editor_plugin.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp
index f960da6732..038ce1467e 100644
--- a/editor/plugins/visual_shader_editor_plugin.cpp
+++ b/editor/plugins/visual_shader_editor_plugin.cpp
@@ -2361,6 +2361,7 @@ void VisualShaderEditor::_add_node(int p_idx, int p_op_idx, String p_resource_pa
position += graph->get_size() * 0.5;
position /= EDSCALE;
}
+ position /= graph->get_zoom();
saved_node_pos_dirty = false;
int id_to_use = visual_shader->get_valid_node_id(type);