diff --git a/Assets/Scripts/UI/Terminal/TerminalRecordPanel.cs b/Assets/Scripts/UI/Terminal/TerminalRecordPanel.cs index 9ea827ab2..e928a322c 100644 --- a/Assets/Scripts/UI/Terminal/TerminalRecordPanel.cs +++ b/Assets/Scripts/UI/Terminal/TerminalRecordPanel.cs @@ -116,8 +116,9 @@ namespace AibisDream.UI private System.Collections.IEnumerator DrawRecordsWhenReady() { - yield return null; DrawRecords(); + yield return null; + ScrollToBottom(); } private void ConfigureContentRect() @@ -179,12 +180,22 @@ namespace AibisDream.UI { LayoutRebuilder.ForceRebuildLayoutImmediate(contentRect); } + } - if (scrollRect != null) + private void ScrollToBottom() + { + if (scrollRect == null) { - Canvas.ForceUpdateCanvases(); - scrollRect.verticalNormalizedPosition = 1f; + return; } + + if (recordRoot is RectTransform contentRect) + { + LayoutRebuilder.ForceRebuildLayoutImmediate(contentRect); + } + + Canvas.ForceUpdateCanvases(); + scrollRect.verticalNormalizedPosition = 0f; } private void ClearRecordItems()