Merge branch 'cursor-changes' of https://github.com/Tryibion/FlaxEngine into Tryibion-cursor-changes

This commit is contained in:
Wojtek Figat
2022-10-10 18:33:29 +02:00
2 changed files with 32 additions and 0 deletions

View File

@@ -23,6 +23,7 @@ namespace FlaxEngine.GUI
private float _splitterValue;
private Rectangle _splitterRect;
private bool _splitterClicked, _mouseOverSplitter;
private bool _cursorChanged;
/// <summary>
/// The first panel (left or upper based on Orientation).
@@ -161,6 +162,18 @@ namespace FlaxEngine.GUI
if (_splitterClicked)
{
SplitterValue = _orientation == Orientation.Horizontal ? location.X / Width : location.Y / Height;
Cursor = _orientation == Orientation.Horizontal ? CursorType.SizeWE : CursorType.SizeNS;
_cursorChanged = true;
}
else if (_mouseOverSplitter)
{
Cursor = _orientation == Orientation.Horizontal ? CursorType.SizeWE : CursorType.SizeNS;
_cursorChanged = true;
}
else if (_cursorChanged)
{
Cursor = CursorType.Default;
_cursorChanged = false;
}
base.OnMouseMove(location);