From 9002590990a4b8ddfc5ba0a0e83ae489a09cafdb Mon Sep 17 00:00:00 2001 From: Michael Alexsander Date: Mon, 3 Feb 2025 18:27:31 -0300 Subject: [PATCH] Fix wrong inspector offset on scene switch --- editor/editor_inspector.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index b79d1243ba6c..97335821374e 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -4138,7 +4138,8 @@ void EditorInspector::expand_revertable() { } void EditorInspector::set_scroll_offset(int p_offset) { - set_v_scroll(p_offset); + // This can be called before the container finishes sorting its children, so defer it. + callable_mp((ScrollContainer *)this, &ScrollContainer::set_v_scroll).call_deferred(p_offset); } int EditorInspector::get_scroll_offset() const {