summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-01-04 00:37:43 +0100
committerGitHub <noreply@github.com>2022-01-04 00:37:43 +0100
commit8501233401cd53a6bd6def78202856828ce2a40f (patch)
treed2b460d77cc47bd0eadbae95e52b46e9a8b7d4bd /scene/gui
parent1d6f8ad837439b5304f1ef9994410d372dff947c (diff)
parent0af3d6b9908323b9806e1593d116cd4d4587de83 (diff)
Merge pull request #56347 from NNesh/fix/graph_editor_out_of_range_alignment
Fixed an invalidation of sets and out of range for an alignment
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/graph_edit.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp
index 445bae645b..1ddec4f587 100644
--- a/scene/gui/graph_edit.cpp
+++ b/scene/gui/graph_edit.cpp
@@ -1692,7 +1692,7 @@ int GraphEdit::_set_operations(SET_OPERATIONS p_operation, Set<StringName> &r_u,
r_u.insert(E->get());
}
}
- return r_v.size();
+ return r_u.size();
} break;
default:
break;
@@ -1787,8 +1787,8 @@ void GraphEdit::_horizontal_alignment(Dictionary &r_root, Dictionary &r_align, c
}
}
- int start = up.size() / 2;
- int end = up.size() % 2 ? start : start + 1;
+ int start = (up.size() - 1) / 2;
+ int end = (up.size() - 1) % 2 ? start + 1 : start;
for (int p = start; p <= end; p++) {
StringName Align = r_align[current_node];
if (Align == current_node && r < up[p].first) {