Add timeline view panning with right-mouse button even over keyframes editor or curve editor

This commit is contained in:
Wojtek Figat
2021-08-24 12:56:36 +02:00
parent ee3f7aeb53
commit 603c9fac07
8 changed files with 79 additions and 21 deletions

View File

@@ -1809,6 +1809,30 @@ namespace FlaxEditor.GUI.Timeline
{
}
/// <summary>
/// Custom event for keyframes or curve editor view panning to handle timeline background panning horizontally too.
/// </summary>
/// <seealso cref="KeyframesEditor.CustomViewPanning"/>
/// <seealso cref="CurveEditorBase.CustomViewPanning"/>
/// <param name="delta">The input delta.</param>
/// <returns>The result input delta.</returns>
public Vector2 OnKeyframesViewPanning(Vector2 delta)
{
var area = _backgroundArea;
var hScroll = area.HScrollBar.Visible && area.HScrollBar.Enabled;
if (hScroll)
{
bool wasLocked = area.IsLayoutLocked;
area.IsLayoutLocked = true;
area.HScrollBar.TargetValue -= delta.X;
delta.X = 0.0f;
area.IsLayoutLocked = wasLocked;
area.PerformLayout();
area.Cursor = CursorType.SizeWE;
}
return delta;
}
/// <summary>
/// Mark timeline as edited.
/// </summary>