Skip to content

Commit 50b465d

Browse files
committed
Fixed log scroll view not snapping to bottom properly.
1 parent bc1ed2f commit 50b465d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1717
- Changed DevConsole.InvokeCoroutine method to return the Coroutine instance.
1818
- Fixed Unity logs from other threads not showing in the developer console log.
1919
- Fixed generic or nullable parameter types not having their type displayed nicely.
20-
- Fixed log scroll view not snapping to bottom intuitively (somewhat).
20+
- Fixed log scroll view not snapping to bottom intuitively.
2121

2222
## [0.2.1-alpha] - 2021-08-09
2323
- Added documentation.

Runtime/DevConsoleMono.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -902,8 +902,9 @@ private void LateUpdate()
902902
// Process the stored logs, displaying them to the console
903903
if (StoredLogText != string.Empty)
904904
{
905-
// Check if should scroll to the bottom (not working - vertical changes between Update() and LateUpdate() - why???!!!)
906-
if (_pretendScrollAtBottom || _logScrollView.verticalNormalizedPosition < 0f || Mathf.Approximately(_logScrollView.verticalNormalizedPosition, 0f) || _logScrollView.verticalNormalizedPosition < 0.1f)
905+
// Check if should scroll to the bottom
906+
const float scrollPerc = 0.001f;
907+
if (_pretendScrollAtBottom || _logScrollView.verticalNormalizedPosition < scrollPerc || Mathf.Approximately(_logScrollView.verticalNormalizedPosition, scrollPerc))
907908
{
908909
_scrollToBottomNextFrame = true;
909910
}

0 commit comments

Comments
 (0)