Fix the profiler charts in place and only scroll profiler info.

This commit is contained in:
Chandler Cox
2024-06-18 19:25:12 -05:00
parent 0d8691045b
commit 224c2c049e
4 changed files with 84 additions and 48 deletions

View File

@@ -38,12 +38,29 @@ namespace FlaxEditor.Windows.Profiler
: base("Assets")
{
// Layout
var panel = new Panel(ScrollBars.Vertical)
var mainPanel = new Panel(ScrollBars.None)
{
AnchorPreset = AnchorPresets.StretchAll,
Offsets = Margin.Zero,
Parent = this,
};
// Chart
_memoryUsageChart = new SingleChart
{
Title = "Assets Memory Usage (CPU)",
AnchorPreset = AnchorPresets.HorizontalStretchTop,
FormatSample = v => Utilities.Utils.FormatBytesCount((int)v),
Parent = mainPanel,
};
_memoryUsageChart.SelectedSampleChanged += OnSelectedSampleChanged;
var panel = new Panel(ScrollBars.Vertical)
{
AnchorPreset = AnchorPresets.StretchAll,
Offsets = new Margin(0, 0, _memoryUsageChart.Height + 2, 0),
Parent = mainPanel,
};
var layout = new VerticalPanel
{
AnchorPreset = AnchorPresets.HorizontalStretchTop,
@@ -52,15 +69,6 @@ namespace FlaxEditor.Windows.Profiler
Parent = panel,
};
// Chart
_memoryUsageChart = new SingleChart
{
Title = "Assets Memory Usage (CPU)",
FormatSample = v => Utilities.Utils.FormatBytesCount((int)v),
Parent = layout,
};
_memoryUsageChart.SelectedSampleChanged += OnSelectedSampleChanged;
// Table
var style = Style.Current;
var headerColor = style.LightBackground;