mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Misc editor speedups for large scenes
This commit is contained in:
parent
d5ad0556a2
commit
e73e978d65
4 changed files with 13 additions and 3 deletions
|
@ -4477,6 +4477,8 @@ Error EditorNode::load_scene(const String &p_scene, bool p_ignore_broken_deps, b
|
|||
new_scene->set_scene_instance_state(Ref<SceneState>());
|
||||
|
||||
set_edited_scene(new_scene);
|
||||
// When editor plugins load in, they might use node transforms during their own setup, so make sure they're up to date.
|
||||
get_tree()->flush_transform_notifications();
|
||||
|
||||
String config_file_path = EditorPaths::get_singleton()->get_project_settings_dir().path_join(lpath.get_file() + "-editstate-" + lpath.md5_text() + ".cfg");
|
||||
Ref<ConfigFile> editor_state_cf;
|
||||
|
|
|
@ -622,7 +622,6 @@ void CanvasItemEditor::_find_canvas_items_at_pos(const Point2 &p_pos, Node *p_no
|
|||
return;
|
||||
}
|
||||
|
||||
const real_t grab_distance = EDITOR_GET("editors/polygon_editor/point_grab_radius");
|
||||
CanvasItem *ci = Object::cast_to<CanvasItem>(p_node);
|
||||
|
||||
Transform2D xform = p_canvas_xform;
|
||||
|
@ -4149,6 +4148,8 @@ void CanvasItemEditor::_update_editor_settings() {
|
|||
real_t ruler_width_unscaled = EDITOR_GET("editors/2d/ruler_width");
|
||||
ruler_font_size = MAX(get_theme_font_size(SNAME("rulers_size"), EditorStringName(EditorFonts)) * ruler_width_unscaled / 15.0, 8);
|
||||
ruler_width_scaled = MAX(ruler_width_unscaled * EDSCALE, ruler_font_size * 2.0);
|
||||
|
||||
grab_distance = EDITOR_GET("editors/polygon_editor/point_grab_radius");
|
||||
}
|
||||
|
||||
void CanvasItemEditor::_project_settings_changed() {
|
||||
|
@ -4268,7 +4269,8 @@ void CanvasItemEditor::_notification(int p_what) {
|
|||
case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
|
||||
if (EditorThemeManager::is_generated_theme_outdated() ||
|
||||
EditorSettings::get_singleton()->check_changed_settings_in_group("editors/panning") ||
|
||||
EditorSettings::get_singleton()->check_changed_settings_in_group("editors/2d")) {
|
||||
EditorSettings::get_singleton()->check_changed_settings_in_group("editors/2d") ||
|
||||
EditorSettings::get_singleton()->check_changed_settings_in_group("editors/polygon_editor")) {
|
||||
_update_editor_settings();
|
||||
update_viewport();
|
||||
}
|
||||
|
|
|
@ -259,6 +259,7 @@ private:
|
|||
real_t ruler_width_scaled = 16.0;
|
||||
int ruler_font_size = 8;
|
||||
Point2 node_create_position;
|
||||
real_t grab_distance = 0.0;
|
||||
|
||||
MenuOption last_option;
|
||||
|
||||
|
|
|
@ -706,7 +706,12 @@ void SceneTreeEditor::_node_visibility_changed(Node *p_node) {
|
|||
return;
|
||||
}
|
||||
|
||||
TreeItem *item = _find(tree->get_root(), p_node->get_path());
|
||||
TreeItem *item;
|
||||
if (I->value.item && I->value.item->get_metadata(0) == p_node->get_path()) {
|
||||
item = I->value.item;
|
||||
} else {
|
||||
item = _find(tree->get_root(), p_node->get_path());
|
||||
}
|
||||
|
||||
if (!item) {
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue