1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-05 17:15:09 +00:00

Speed up large selections in the editor

This commit is contained in:
Mike Precup
2025-08-08 11:28:47 -07:00
parent a3b42d85d2
commit 1c8e3f9037
12 changed files with 111 additions and 86 deletions

View File

@@ -770,7 +770,7 @@ SizeFlagPresetPicker::SizeFlagPresetPicker(bool p_vertical) {
void ControlEditorToolbar::_anchors_preset_selected(int p_preset) {
LayoutPreset preset = (LayoutPreset)p_preset;
List<Node *> selection = editor_selection->get_top_selected_node_list();
const List<Node *> &selection = editor_selection->get_top_selected_node_list();
EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
undo_redo->create_action(TTR("Change Anchors, Offsets, Grow Direction"));
@@ -791,7 +791,7 @@ void ControlEditorToolbar::_anchors_preset_selected(int p_preset) {
}
void ControlEditorToolbar::_anchors_to_current_ratio() {
List<Node *> selection = editor_selection->get_top_selected_node_list();
const List<Node *> &selection = editor_selection->get_top_selected_node_list();
EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
undo_redo->create_action(TTR("Change Anchors, Offsets (Keep Ratio)"));
@@ -842,7 +842,7 @@ void ControlEditorToolbar::_anchor_mode_toggled(bool p_status) {
}
void ControlEditorToolbar::_container_flags_selected(int p_flags, bool p_vertical) {
List<Node *> selection = editor_selection->get_top_selected_node_list();
const List<Node *> &selection = editor_selection->get_top_selected_node_list();
EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
if (p_vertical) {
@@ -869,7 +869,7 @@ void ControlEditorToolbar::_container_flags_selected(int p_flags, bool p_vertica
}
void ControlEditorToolbar::_expand_flag_toggled(bool p_expand, bool p_vertical) {
List<Node *> selection = editor_selection->get_top_selected_node_list();
const List<Node *> &selection = editor_selection->get_top_selected_node_list();
EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
if (p_vertical) {
@@ -1003,7 +1003,7 @@ void ControlEditorToolbar::_selection_changed() {
int nb_valid_controls = 0;
int nb_anchors_mode = 0;
List<Node *> selection = editor_selection->get_top_selected_node_list();
const List<Node *> &selection = editor_selection->get_top_selected_node_list();
for (Node *E : selection) {
Control *control = Object::cast_to<Control>(E);
if (!control) {
@@ -1053,7 +1053,7 @@ void ControlEditorToolbar::_selection_changed() {
int nb_h_expand = 0;
int nb_v_expand = 0;
List<Node *> selection = editor_selection->get_top_selected_node_list();
const List<Node *> &selection = editor_selection->get_top_selected_node_list();
for (Node *E : selection) {
Control *control = Object::cast_to<Control>(E);
if (!control) {