Fix dragging existing connection
Undo stack
This commit is contained in:
@@ -97,7 +97,7 @@ namespace FlaxEditor.Surface.Elements
|
||||
var connections = Connections.ToArray();
|
||||
for (int i = 0; i < connections.Length; i++)
|
||||
{
|
||||
var targetBox = Connections[i];
|
||||
var targetBox = connections[i];
|
||||
|
||||
// Break connection
|
||||
Connections.Remove(targetBox);
|
||||
@@ -568,9 +568,19 @@ namespace FlaxEditor.Surface.Elements
|
||||
{
|
||||
if (!IsOutput && HasSingleConnection)
|
||||
{
|
||||
var inputBox = Connections[0];
|
||||
BreakConnection(inputBox);
|
||||
Surface.ConnectingStart(inputBox);
|
||||
var connectedBox = Connections[0];
|
||||
if (Surface.Undo != null)
|
||||
{
|
||||
var action = new ConnectBoxesAction((InputBox)this, (OutputBox)connectedBox, false);
|
||||
BreakConnection(connectedBox);
|
||||
action.End();
|
||||
Surface.Undo.AddAction(action);
|
||||
}
|
||||
else
|
||||
{
|
||||
BreakConnection(connectedBox);
|
||||
}
|
||||
Surface.ConnectingStart(connectedBox);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user