fix new messages being cut off in Debug Log

Happens when there are a lot of messages logged at once
This commit is contained in:
xxSeys1
2025-03-28 19:38:51 +01:00
parent faa3f62813
commit f025d96111

View File

@@ -707,13 +707,13 @@ namespace FlaxEditor.Windows
// Scroll to the new entry (if any added to view)
if (scrollView && anyVisible)
{
panelScroll.ScrollViewTo(newEntry);
panelScroll.ScrollViewTo(newEntry, true);
bool scrollViewNew = (panelScroll.VScrollBar.Maximum - panelScroll.VScrollBar.TargetValue) < LogEntry.DefaultHeight * 1.5f;
if (scrollViewNew != scrollView)
{
// Make sure scrolling doesn't stop in case too many entries were added at once
panelScroll.ScrollViewTo(new Float2(float.MaxValue, float.MaxValue));
panelScroll.ScrollViewTo(new Float2(float.MaxValue, float.MaxValue), true);
}
}
}