Fix timeline curve expanding to properly show whole curve area

This commit is contained in:
2026-10-01 15:18:45 +02:00
parent aac6a3a4b8
commit 3ea2a4df70
3 changed files with 17 additions and 1 deletions
+5
View File
@@ -100,6 +100,11 @@ namespace FlaxEditor.GUI
/// </summary>
public abstract Type ValueType { get; }
/// <summary>
/// Gets the main container control that holds the curve editor UI. Can be used to add custom controls to the curve editor.
/// </summary>
public abstract Panel MainPanel { get; }
/// <summary>
/// The amount of frames per second of the curve animation (optional). Can be used to restrict the keyframes time values to the given time quantization rate.
/// </summary>
+3
View File
@@ -633,6 +633,9 @@ namespace FlaxEditor.GUI
/// <inheritdoc />
public override Type ValueType => typeof(T);
/// <inheritdoc />
public override Panel MainPanel => _mainPanel;
/// <inheritdoc />
public override float? FPS
{
@@ -292,7 +292,15 @@ namespace FlaxEditor.GUI.Timeline.Tracks
Height = IsExpanded ? _expandedHeight : CollapsedHeight;
UpdateCurve();
if (IsExpanded)
{
// Layout bug: whole curve showing after track resize needs panel scrolls bars s smoothing disabled and showing twice
Curve.MainPanel.VScrollBar?.EnableSmoothing = false;
Curve.MainPanel.HScrollBar?.EnableSmoothing = false;
Curve.ShowWholeCurve();
Curve.ShowWholeCurve();
Curve.MainPanel.VScrollBar?.EnableSmoothing = true;
Curve.MainPanel.HScrollBar?.EnableSmoothing = true;
}
base.OnExpandedChanged();
}
@@ -311,7 +319,7 @@ namespace FlaxEditor.GUI.Timeline.Tracks
UpdatePreviewValue();
}
/// <inheritdoc />
/// <inheritdoc />
public override void OnUndo()
{
base.OnUndo();