1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

Fixed console error spam (about invalid edited scene index)

This commit is contained in:
Yuri Roubinsky
2021-05-26 19:28:38 +03:00
parent 27baa12670
commit af3f047f49
3 changed files with 6 additions and 4 deletions

View File

@@ -4380,7 +4380,7 @@ void CanvasItemEditor::_update_scrollbars() {
// Calculate scrollable area.
Rect2 canvas_item_rect = Rect2(Point2(), screen_rect);
if (editor->get_edited_scene()) {
if (editor->is_inside_tree() && editor->get_edited_scene()) {
Rect2 content_rect = _get_encompassing_rect(editor->get_edited_scene());
canvas_item_rect.expand_to(content_rect.position);
canvas_item_rect.expand_to(content_rect.position + content_rect.size);