Adjust curve background drawing for timeline
This commit is contained in:
@@ -87,7 +87,7 @@ namespace FlaxEditor.GUI
|
||||
/// <summary>
|
||||
/// Enables drawing time and values axes (lines and labels).
|
||||
/// </summary>
|
||||
public bool ShowAxes = true;
|
||||
public UseMode ShowAxes = UseMode.On;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the curves keyframes value.
|
||||
|
||||
@@ -793,7 +793,7 @@ namespace FlaxEditor.GUI
|
||||
}
|
||||
|
||||
// Draw time and values axes
|
||||
if (ShowAxes)
|
||||
if (ShowAxes != UseMode.Off)
|
||||
{
|
||||
var upperLeft = PointToKeyframes(viewRect.Location, ref viewRect);
|
||||
var bottomRight = PointToKeyframes(viewRect.Size, ref viewRect);
|
||||
@@ -804,8 +804,10 @@ namespace FlaxEditor.GUI
|
||||
|
||||
Render2D.PushClip(ref viewRect);
|
||||
|
||||
DrawAxis(Vector2.UnitX, ref viewRect, min.X, max.X, pixelRange.X);
|
||||
DrawAxis(Vector2.UnitY, ref viewRect, min.Y, max.Y, pixelRange.Y);
|
||||
if ((ShowAxes & UseMode.Vertical) == UseMode.Vertical)
|
||||
DrawAxis(Vector2.UnitX, ref viewRect, min.X, max.X, pixelRange.X);
|
||||
if ((ShowAxes & UseMode.Horizontal) == UseMode.Horizontal)
|
||||
DrawAxis(Vector2.UnitY, ref viewRect, min.Y, max.Y, pixelRange.Y);
|
||||
|
||||
Render2D.PopClip();
|
||||
}
|
||||
|
||||
@@ -493,7 +493,7 @@ namespace FlaxEditor.GUI.Timeline.Tracks
|
||||
}
|
||||
Curve.ShowCollapsed = !expanded;
|
||||
Curve.ShowBackground = expanded;
|
||||
Curve.ShowAxes = expanded;
|
||||
Curve.ShowAxes = expanded ? CurveEditorBase.UseMode.Horizontal : CurveEditorBase.UseMode.Off;
|
||||
Curve.Visible = Visible;
|
||||
Curve.UpdateKeyframes();
|
||||
}
|
||||
|
||||
@@ -231,8 +231,7 @@ namespace FlaxEditor.GUI.Timeline.Tracks
|
||||
Curve.Bounds = new Rectangle(Timeline.StartOffset, Y + 1.0f, Timeline.Duration * Timeline.UnitsPerSecond * Timeline.Zoom, Height - 2.0f);
|
||||
Curve.ViewScale = new Vector2(Timeline.Zoom, Curve.ViewScale.Y);
|
||||
Curve.ShowCollapsed = !expanded;
|
||||
Curve.ShowBackground = expanded;
|
||||
Curve.ShowAxes = expanded;
|
||||
Curve.ShowAxes = expanded ? CurveEditorBase.UseMode.Horizontal : CurveEditorBase.UseMode.Off;
|
||||
Curve.EnableZoom = expanded ? CurveEditorBase.UseMode.Vertical : CurveEditorBase.UseMode.Off;
|
||||
Curve.EnablePanning = expanded ? CurveEditorBase.UseMode.Vertical : CurveEditorBase.UseMode.Off;
|
||||
Curve.ScrollBars = expanded ? ScrollBars.Vertical : ScrollBars.None;
|
||||
@@ -293,6 +292,7 @@ namespace FlaxEditor.GUI.Timeline.Tracks
|
||||
Curve = (CurveEditorBase)Activator.CreateInstance(curveEditorType);
|
||||
Curve.EnableZoom = CurveEditorBase.UseMode.Vertical;
|
||||
Curve.EnablePanning = CurveEditorBase.UseMode.Vertical;
|
||||
Curve.ShowBackground = false;
|
||||
Curve.ScrollBars = ScrollBars.Vertical;
|
||||
Curve.Parent = Timeline?.MediaPanel;
|
||||
Curve.FPS = Timeline?.FramesPerSecond;
|
||||
|
||||
Reference in New Issue
Block a user