summaryrefslogtreecommitdiff
path: root/scene
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 /scene
parentca56d907222a435088f9429c5a9ccccf5f7446ce (diff)
parentb74f1abd2569513f34efb13b351f98898d8ca184 (diff)
Merge pull request #44009 from Chaosus/vs_fix_expression_bugs
Fix few bugs in visual shader expressions
Diffstat (limited to 'scene')
-rw-r--r--scene/resources/visual_shader.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/scene/resources/visual_shader.cpp b/scene/resources/visual_shader.cpp
index 09478e98b2..dd9f64693e 100644
--- a/scene/resources/visual_shader.cpp
+++ b/scene/resources/visual_shader.cpp
@@ -2767,8 +2767,10 @@ void VisualShaderNodeGroupBase::remove_input_port(int p_id) {
inputs.erase(index, count);
inputs_strings = inputs.split(";", false);
+ inputs = inputs.substr(0, index);
+
for (int i = p_id; i < inputs_strings.size(); i++) {
- inputs = inputs.replace_first(inputs_strings[i].split(",")[0], itos(i));
+ inputs += inputs_strings[i].replace_first(inputs_strings[i].split(",")[0], itos(i)) + ";";
}
_apply_port_changes();
@@ -2837,8 +2839,10 @@ void VisualShaderNodeGroupBase::remove_output_port(int p_id) {
outputs.erase(index, count);
outputs_strings = outputs.split(";", false);
+ outputs = outputs.substr(0, index);
+
for (int i = p_id; i < outputs_strings.size(); i++) {
- outputs = outputs.replace_first(outputs_strings[i].split(",")[0], itos(i));
+ outputs += outputs_strings[i].replace_first(outputs_strings[i].split(",")[0], itos(i)) + ";";
}
_apply_port_changes();