From 3ea2a4df70e0392f140415040864ad009b5e2045 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Thu, 1 Oct 2026 15:18:45 +0200 Subject: [PATCH] Fix timeline curve expanding to properly show whole curve area --- Source/Editor/GUI/CurveEditor.Base.cs | 5 +++++ Source/Editor/GUI/CurveEditor.cs | 3 +++ .../Editor/GUI/Timeline/Tracks/CurvePropertyTrack.cs | 10 +++++++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Source/Editor/GUI/CurveEditor.Base.cs b/Source/Editor/GUI/CurveEditor.Base.cs index 04b4b2f72..a48f36943 100644 --- a/Source/Editor/GUI/CurveEditor.Base.cs +++ b/Source/Editor/GUI/CurveEditor.Base.cs @@ -100,6 +100,11 @@ namespace FlaxEditor.GUI /// public abstract Type ValueType { get; } + /// + /// Gets the main container control that holds the curve editor UI. Can be used to add custom controls to the curve editor. + /// + public abstract Panel MainPanel { get; } + /// /// 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. /// diff --git a/Source/Editor/GUI/CurveEditor.cs b/Source/Editor/GUI/CurveEditor.cs index 092cda707..6693dec30 100644 --- a/Source/Editor/GUI/CurveEditor.cs +++ b/Source/Editor/GUI/CurveEditor.cs @@ -633,6 +633,9 @@ namespace FlaxEditor.GUI /// public override Type ValueType => typeof(T); + /// + public override Panel MainPanel => _mainPanel; + /// public override float? FPS { diff --git a/Source/Editor/GUI/Timeline/Tracks/CurvePropertyTrack.cs b/Source/Editor/GUI/Timeline/Tracks/CurvePropertyTrack.cs index 7e974b54f..4fdc5bd89 100644 --- a/Source/Editor/GUI/Timeline/Tracks/CurvePropertyTrack.cs +++ b/Source/Editor/GUI/Timeline/Tracks/CurvePropertyTrack.cs @@ -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(); } - /// + /// public override void OnUndo() { base.OnUndo();