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

@@ -78,22 +78,31 @@ namespace FlaxEditor.GUI
if (_rightMouseDown)
{
Vector2 delta = location - _movingViewLastPos;
if (_editor.CustomViewPanning != null)
delta = _editor.CustomViewPanning(delta);
delta *= GetUseModeMask(_editor.EnablePanning) * _editor.ViewScale;
if (delta.LengthSquared > 0.01f)
{
_editor._mainPanel.ViewOffset += delta;
_movingViewLastPos = location;
switch (_editor.EnablePanning)
if (_editor.CustomViewPanning != null)
{
case UseMode.Vertical:
Cursor = CursorType.SizeNS;
break;
case UseMode.Horizontal:
Cursor = CursorType.SizeWE;
break;
case UseMode.On:
Cursor = CursorType.SizeAll;
break;
}
else
{
switch (_editor.EnablePanning)
{
case UseMode.Vertical:
Cursor = CursorType.SizeNS;
break;
case UseMode.Horizontal:
Cursor = CursorType.SizeWE;
break;
case UseMode.On:
Cursor = CursorType.SizeAll;
break;
}
}
}