summaryrefslogtreecommitdiff
path: root/editor/plugins/visual_shader_editor_plugin.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-12-01 20:10:57 +0100
committerGitHub <noreply@github.com>2020-12-01 20:10:57 +0100
commitba51af7904819b3739173d24567e79ee5d3600f9 (patch)
tree65d199039d07841c0eae100351800d80785d0c31 /editor/plugins/visual_shader_editor_plugin.cpp
parentca56d907222a435088f9429c5a9ccccf5f7446ce (diff)
parentb74f1abd2569513f34efb13b351f98898d8ca184 (diff)
Merge pull request #44009 from Chaosus/vs_fix_expression_bugs
Fix few bugs in visual shader expressions
Diffstat (limited to 'editor/plugins/visual_shader_editor_plugin.cpp')
-rw-r--r--editor/plugins/visual_shader_editor_plugin.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp
index 17be057c00..14598237d8 100644
--- a/editor/plugins/visual_shader_editor_plugin.cpp
+++ b/editor/plugins/visual_shader_editor_plugin.cpp
@@ -1454,6 +1454,17 @@ void VisualShaderEditor::_remove_output_port(int p_node, int p_port) {
}
}
+ int preview_port = node->get_output_port_for_preview();
+ if (preview_port != -1) {
+ if (preview_port == p_port) {
+ undo_redo->add_do_method(node.ptr(), "set_output_port_for_preview", -1);
+ undo_redo->add_undo_method(node.ptr(), "set_output_port_for_preview", preview_port);
+ } else if (preview_port > p_port) {
+ undo_redo->add_do_method(node.ptr(), "set_output_port_for_preview", preview_port - 1);
+ undo_redo->add_undo_method(node.ptr(), "set_output_port_for_preview", preview_port);
+ }
+ }
+
undo_redo->add_do_method(node.ptr(), "remove_output_port", p_port);
undo_redo->add_undo_method(node.ptr(), "add_output_port", p_port, (int)node->get_output_port_type(p_port), node->get_output_port_name(p_port));