Fixed regression of cursor being stuck in default when trying to change it in viewport
This commit is contained in:
@@ -23,6 +23,8 @@ namespace FlaxEngine.GUI
|
||||
private float _splitterValue;
|
||||
private Rectangle _splitterRect;
|
||||
private bool _splitterClicked, _mouseOverSplitter;
|
||||
private bool _leftMouseButtonDown;
|
||||
private bool _rightMouseButtonDown;
|
||||
|
||||
/// <summary>
|
||||
/// The first panel (left or upper based on Orientation).
|
||||
@@ -167,7 +169,7 @@ namespace FlaxEngine.GUI
|
||||
{
|
||||
Cursor = _orientation == Orientation.Horizontal ? CursorType.SizeWE : CursorType.SizeNS;
|
||||
}
|
||||
else
|
||||
else if (!_leftMouseButtonDown && !_rightMouseButtonDown)
|
||||
{
|
||||
Cursor = CursorType.Default;
|
||||
}
|
||||
@@ -178,6 +180,16 @@ namespace FlaxEngine.GUI
|
||||
/// <inheritdoc />
|
||||
public override bool OnMouseDown(Float2 location, MouseButton button)
|
||||
{
|
||||
if (button == MouseButton.Left)
|
||||
{
|
||||
_leftMouseButtonDown = true;
|
||||
}
|
||||
|
||||
if (button == MouseButton.Right)
|
||||
{
|
||||
_rightMouseButtonDown = true;
|
||||
}
|
||||
|
||||
if (button == MouseButton.Left && _splitterRect.Contains(location))
|
||||
{
|
||||
// Start moving splitter
|
||||
@@ -192,6 +204,16 @@ namespace FlaxEngine.GUI
|
||||
/// <inheritdoc />
|
||||
public override bool OnMouseUp(Float2 location, MouseButton button)
|
||||
{
|
||||
if (button == MouseButton.Left)
|
||||
{
|
||||
_leftMouseButtonDown = false;
|
||||
}
|
||||
|
||||
if (button == MouseButton.Right)
|
||||
{
|
||||
_rightMouseButtonDown = false;
|
||||
}
|
||||
|
||||
if (_splitterClicked)
|
||||
{
|
||||
EndTracking();
|
||||
|
||||
Reference in New Issue
Block a user