浏览代码

Fix wrong inspector offset on scene switch

Michael Alexsander 7 月之前
父节点
当前提交
9002590990
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      editor/editor_inspector.cpp

+ 2 - 1
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 {