Fix profiler window tabs layout for charts
This commit is contained in:
@@ -50,6 +50,8 @@ namespace FlaxEditor.Windows.Profiler
|
||||
{
|
||||
Title = "Assets Memory Usage (CPU)",
|
||||
AnchorPreset = AnchorPresets.HorizontalStretchTop,
|
||||
Offsets = Margin.Zero,
|
||||
Height = SingleChart.DefaultHeight,
|
||||
FormatSample = v => Utilities.Utils.FormatBytesCount((int)v),
|
||||
Parent = mainPanel,
|
||||
};
|
||||
|
||||
@@ -69,6 +69,8 @@ namespace FlaxEditor.Windows.Profiler
|
||||
{
|
||||
Title = "Update",
|
||||
AnchorPreset = AnchorPresets.HorizontalStretchTop,
|
||||
Offsets = Margin.Zero,
|
||||
Height = SingleChart.DefaultHeight,
|
||||
FormatSample = v => (Mathf.RoundToInt(v * 10.0f) / 10.0f) + " ms",
|
||||
Parent = mainPanel,
|
||||
};
|
||||
|
||||
@@ -37,6 +37,8 @@ namespace FlaxEditor.Windows.Profiler
|
||||
{
|
||||
Title = "Draw (CPU)",
|
||||
AnchorPreset = AnchorPresets.HorizontalStretchTop,
|
||||
Offsets = Margin.Zero,
|
||||
Height = SingleChart.DefaultHeight,
|
||||
FormatSample = v => (Mathf.RoundToInt(v * 10.0f) / 10.0f) + " ms",
|
||||
Parent = mainPanel,
|
||||
};
|
||||
|
||||
@@ -51,7 +51,9 @@ namespace FlaxEditor.Windows.Profiler
|
||||
{
|
||||
Title = "GPU Memory Usage",
|
||||
AnchorPreset = AnchorPresets.HorizontalStretchTop,
|
||||
FormatSample = v => Utilities.Utils.FormatBytesCount((int)v),
|
||||
Offsets = Margin.Zero,
|
||||
Height = SingleChart.DefaultHeight,
|
||||
FormatSample = v => Utilities.Utils.FormatBytesCount((ulong)v),
|
||||
Parent = mainPanel,
|
||||
};
|
||||
_memoryUsageChart.SelectedSampleChanged += OnSelectedSampleChanged;
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace FlaxEditor.Windows.Profiler
|
||||
/// <seealso cref="FlaxEngine.GUI.Control" />
|
||||
internal class SingleChart : Control
|
||||
{
|
||||
internal const float DefaultHeight = TitleHeight + 60;
|
||||
private const float TitleHeight = 20;
|
||||
private const float PointsOffset = 4;
|
||||
private readonly SamplesBuffer<float> _samples;
|
||||
@@ -63,7 +64,7 @@ namespace FlaxEditor.Windows.Profiler
|
||||
/// </summary>
|
||||
/// <param name="maxSamples">The maximum samples to collect.</param>
|
||||
public SingleChart(int maxSamples = ProfilerMode.MaxSamples)
|
||||
: base(0, 0, 100, 60 + TitleHeight)
|
||||
: base(0, 0, 100, DefaultHeight)
|
||||
{
|
||||
_samples = new SamplesBuffer<float>(maxSamples);
|
||||
_sample = string.Empty;
|
||||
|
||||
Reference in New Issue
Block a user