- Visual fix to preview connection when pulling out of an input box or a reroute node
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
|
// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
|
||||||
|
|
||||||
|
using FlaxEditor.Surface.Elements;
|
||||||
using FlaxEngine;
|
using FlaxEngine;
|
||||||
|
|
||||||
namespace FlaxEditor.Surface
|
namespace FlaxEditor.Surface
|
||||||
@@ -135,8 +136,25 @@ namespace FlaxEditor.Surface
|
|||||||
endPos = _lastInstigatorUnderMouse.ConnectionOrigin;
|
endPos = _lastInstigatorUnderMouse.ConnectionOrigin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Float2 actualStartPos = startPos;
|
||||||
|
Float2 actualEndPos = endPos;
|
||||||
|
|
||||||
|
if (_connectionInstigator is Archetypes.Tools.RerouteNode)
|
||||||
|
{
|
||||||
|
if (endPos.X < startPos.X && _lastInstigatorUnderMouse is null or Box { IsOutput: true})
|
||||||
|
{
|
||||||
|
actualStartPos = endPos;
|
||||||
|
actualEndPos = startPos;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (_connectionInstigator is Box { IsOutput: false })
|
||||||
|
{
|
||||||
|
actualStartPos = endPos;
|
||||||
|
actualEndPos = startPos;
|
||||||
|
}
|
||||||
|
|
||||||
// Draw connection
|
// Draw connection
|
||||||
_connectionInstigator.DrawConnectingLine(ref startPos, ref endPos, ref lineColor);
|
_connectionInstigator.DrawConnectingLine(ref actualStartPos, ref actualEndPos, ref lineColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user