diff --git a/Source/Editor/GUI/CurveEditor.Contents.cs b/Source/Editor/GUI/CurveEditor.Contents.cs index 98507d51f..a892fcef9 100644 --- a/Source/Editor/GUI/CurveEditor.Contents.cs +++ b/Source/Editor/GUI/CurveEditor.Contents.cs @@ -480,6 +480,7 @@ namespace FlaxEditor.GUI cm.AddButton(totalSelectionCount == 1 ? "Copy keyframe" : "Copy keyframes", () => _editor.CopyKeyframes(point)); } cm.AddButton("Paste keyframes", () => KeyframesEditorUtils.Paste(_editor, point?.Time ?? _cmShowPos.X)).Enabled = KeyframesEditorUtils.CanPaste(); + cm.AddSeparator(); cm.AddButton("Edit all keyframes", () => _editor.EditAllKeyframes(this, location)); cm.AddButton("Select all keyframes", _editor.SelectAll); cm.AddButton("Copy all keyframes", () => diff --git a/Source/Editor/GUI/CurveEditor.cs b/Source/Editor/GUI/CurveEditor.cs index d4b31a9e7..4120f1348 100644 --- a/Source/Editor/GUI/CurveEditor.cs +++ b/Source/Editor/GUI/CurveEditor.cs @@ -1407,13 +1407,14 @@ namespace FlaxEditor.GUI } // Adjust contents bounds to fill the curve area - if (EnablePanning != UseMode.Off) + if (EnablePanning != UseMode.Off || !ShowCollapsed) { bounds.Width = Mathf.Max(bounds.Width, 1.0f); bounds.Height = Mathf.Max(bounds.Height, 1.0f); bounds.Location = ApplyUseModeMask(EnablePanning, bounds.Location, _contents.Location); bounds.Size = ApplyUseModeMask(EnablePanning, bounds.Size, _contents.Size); - _contents.Bounds = bounds; + if (!_contents._isMovingSelection) + _contents.Bounds = bounds; } else if (_contents.Bounds == Rectangle.Empty) { @@ -2124,7 +2125,7 @@ namespace FlaxEditor.GUI } // Adjust contents bounds to fill the curve area - if (EnablePanning != UseMode.Off) + if (EnablePanning != UseMode.Off || !ShowCollapsed) { bounds.Width = Mathf.Max(bounds.Width, 1.0f); bounds.Height = Mathf.Max(bounds.Height, 1.0f); diff --git a/Source/Editor/GUI/Timeline/GUI/KeyframesEditor.cs b/Source/Editor/GUI/Timeline/GUI/KeyframesEditor.cs index c3969de8d..a85c9e2b7 100644 --- a/Source/Editor/GUI/Timeline/GUI/KeyframesEditor.cs +++ b/Source/Editor/GUI/Timeline/GUI/KeyframesEditor.cs @@ -427,6 +427,7 @@ namespace FlaxEditor.GUI cm.AddButton(totalSelectionCount == 1 ? "Copy keyframe" : "Copy keyframes", () => _editor.CopyKeyframes(point)); } cm.AddButton("Paste keyframes", () => KeyframesEditorUtils.Paste(_editor, point?.Time ?? _cmShowPos.X)).Enabled = KeyframesEditorUtils.CanPaste(); + cm.AddSeparator(); if (_editor.EnableKeyframesValueEdit) cm.AddButton("Edit all keyframes", () => _editor.EditAllKeyframes(this, location)); cm.AddButton("Select all keyframes", _editor.SelectAll).Enabled = _editor._points.Count > 0; diff --git a/Source/Editor/GUI/Timeline/Tracks/AudioTrack.cs b/Source/Editor/GUI/Timeline/Tracks/AudioTrack.cs index 497e0f9d4..197e889a6 100644 --- a/Source/Editor/GUI/Timeline/Tracks/AudioTrack.cs +++ b/Source/Editor/GUI/Timeline/Tracks/AudioTrack.cs @@ -307,6 +307,7 @@ namespace FlaxEditor.GUI.Timeline.Tracks ScrollBars = ScrollBars.None, DefaultValue = 1.0f, ShowStartEndLines = true, + ShowBackground = false, }; Curve.Edited += OnCurveEdited; Curve.EditingStart += OnCurveEditingStart; @@ -489,13 +490,11 @@ namespace FlaxEditor.GUI.Timeline.Tracks Curve.KeyframesEditorContext = Timeline; Curve.CustomViewPanning = Timeline.OnKeyframesViewPanning; Curve.Bounds = new Rectangle(_audioMedia.X, Y + 1.0f, _audioMedia.Width, Height - 2.0f); - var expanded = IsExpanded; if (expanded) { - //Curve.ViewScale = new Vector2(1.0f, CurveEditor.UnitsPerSecond / Curve.Height); - Curve.ViewScale = new Vector2(Timeline.Zoom, 0.4f); - Curve.ViewOffset = new Vector2(0.0f, 30.0f); + Curve.ViewScale = new Vector2(Timeline.Zoom, 0.7f); + Curve.ViewOffset = new Vector2(0.0f, 35.0f); } else { @@ -503,9 +502,7 @@ namespace FlaxEditor.GUI.Timeline.Tracks Curve.ViewOffset = Vector2.Zero; } Curve.ShowCollapsed = !expanded; - Curve.ShowBackground = expanded; Curve.ShowAxes = expanded ? CurveEditorBase.UseMode.Horizontal : CurveEditorBase.UseMode.Off; - Curve.Visible = Visible; Curve.UpdateKeyframes(); }