Add timeline view panning with right-mouse button even over keyframes editor or curve editor
This commit is contained in:
@@ -476,7 +476,10 @@ namespace FlaxEditor.GUI.Timeline.Tracks
|
||||
{
|
||||
if (_audioMedia == null || Curve == null || Timeline == null)
|
||||
return;
|
||||
|
||||
Curve.Visible = Visible;
|
||||
if (!Visible)
|
||||
return;
|
||||
Curve.CustomViewPanning = Timeline.OnKeyframesViewPanning;
|
||||
Curve.Bounds = new Rectangle(_audioMedia.X, Y + 1.0f, _audioMedia.Width, Height - 2.0f);
|
||||
|
||||
var expanded = IsExpanded;
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace FlaxEditor.GUI.Timeline.Tracks
|
||||
|
||||
return base.OnMouseDown(location, button);
|
||||
}
|
||||
|
||||
|
||||
public override void OnMouseMove(Vector2 location)
|
||||
{
|
||||
base.OnMouseMove(location);
|
||||
@@ -84,7 +84,7 @@ namespace FlaxEditor.GUI.Timeline.Tracks
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public override bool OnMouseUp(Vector2 location, MouseButton button)
|
||||
{
|
||||
if (button == MouseButton.Left && _clicked)
|
||||
@@ -228,6 +228,7 @@ namespace FlaxEditor.GUI.Timeline.Tracks
|
||||
if (!Visible)
|
||||
return;
|
||||
var expanded = IsExpanded;
|
||||
Curve.CustomViewPanning = Timeline.OnKeyframesViewPanning;
|
||||
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;
|
||||
@@ -238,7 +239,7 @@ namespace FlaxEditor.GUI.Timeline.Tracks
|
||||
Curve.UpdateKeyframes();
|
||||
if (expanded)
|
||||
{
|
||||
if(_splitter == null)
|
||||
if (_splitter == null)
|
||||
_splitter = new Splitter
|
||||
{
|
||||
_track = this,
|
||||
|
||||
@@ -281,9 +281,12 @@ namespace FlaxEditor.GUI.Timeline.Tracks
|
||||
|
||||
private void UpdateEvents()
|
||||
{
|
||||
if (Events == null)
|
||||
if (Events == null || Timeline == null)
|
||||
return;
|
||||
|
||||
Events.Visible = Visible;
|
||||
if (!Visible)
|
||||
return;
|
||||
Events.CustomViewPanning = Timeline.OnKeyframesViewPanning;
|
||||
Events.Bounds = new Rectangle(Timeline.StartOffset, Y + 1.0f, Timeline.Duration * Timeline.UnitsPerSecond * Timeline.Zoom, Height - 2.0f);
|
||||
Events.ViewScale = new Vector2(Timeline.Zoom, 1.0f);
|
||||
Events.Visible = Visible;
|
||||
|
||||
@@ -248,11 +248,12 @@ namespace FlaxEditor.GUI.Timeline.Tracks
|
||||
|
||||
private void UpdateKeyframes()
|
||||
{
|
||||
if (Keyframes == null)
|
||||
if (Keyframes == null || Timeline == null)
|
||||
return;
|
||||
Keyframes.Visible = Visible;
|
||||
if (!Visible)
|
||||
return;
|
||||
Keyframes.CustomViewPanning = Timeline.OnKeyframesViewPanning;
|
||||
Keyframes.Bounds = new Rectangle(Timeline.StartOffset, Y + 1.0f, Timeline.Duration * Timeline.UnitsPerSecond * Timeline.Zoom, Height - 2.0f);
|
||||
Keyframes.ViewScale = new Vector2(Timeline.Zoom, 1.0f);
|
||||
Keyframes.UpdateKeyframes();
|
||||
|
||||
Reference in New Issue
Block a user