From 313263e54167c259e5547bd2ec5b8cc342e9170f Mon Sep 17 00:00:00 2001 From: Amir Alizadeh Date: Thu, 31 Oct 2024 23:30:40 +0330 Subject: [PATCH] Fix output log scroll reset on new log entries addition bug --- Source/Editor/Windows/OutputLogWindow.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/Editor/Windows/OutputLogWindow.cs b/Source/Editor/Windows/OutputLogWindow.cs index f8c4ea9b5..1ce17218e 100644 --- a/Source/Editor/Windows/OutputLogWindow.cs +++ b/Source/Editor/Windows/OutputLogWindow.cs @@ -600,8 +600,10 @@ namespace FlaxEditor.Windows // Update the output var cachedScrollValue = _vScroll.Value; var cachedSelection = _output.SelectionRange; - var isBottomScroll = _vScroll.Value >= _vScroll.Maximum - 20.0f || wasEmpty; + var cachedOutputTargetViewOffset = _output.TargetViewOffset; + var isBottomScroll = _vScroll.Value >= _vScroll.Maximum - (_scrollSize*2) || wasEmpty; _output.Text = _textBuffer.ToString(); + _output.TargetViewOffset = cachedOutputTargetViewOffset; _textBufferCount = _entries.Count; if (!_vScroll.IsThumbClicked) _vScroll.TargetValue = isBottomScroll ? _vScroll.Maximum : cachedScrollValue;