diff --git a/Source/Editor/GUI/Timeline/Timeline.cs b/Source/Editor/GUI/Timeline/Timeline.cs index 15e7eb953..1fb19e9ec 100644 --- a/Source/Editor/GUI/Timeline/Timeline.cs +++ b/Source/Editor/GUI/Timeline/Timeline.cs @@ -2148,10 +2148,9 @@ namespace FlaxEditor.GUI.Timeline /// public void ShowWholeTimeline() { - var viewWidth = Width; - var timelineWidth = Duration * UnitsPerSecond * Zoom + 8 * StartOffset; - _backgroundArea.ViewOffset = Float2.Zero; - Zoom = viewWidth / timelineWidth; + const float padding = 40f; + Zoom = (_backgroundArea.Width - padding * 2f) / (Duration * UnitsPerSecond); + _backgroundArea.ViewOffset = new Float2(-_leftEdge.X + padding, _backgroundArea.ViewOffset.Y); } ///