mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +00:00
Fix auto connecting nodes
This commit is contained in:
1 parent
73933ee324
commit
88558efcb1
4 files changed
+41
-17
No files matched your search
@@ -50,7 +50,6 @@ public class NodePickerViewModel : ActivatableViewModelBase
|
||||
this.WhenActivated(d =>
|
||||
{
|
||||
SearchText = null;
|
||||
TargetPin = null;
|
||||
|
||||
nodeSourceList.Edit(list =>
|
||||
{
|
||||
@@ -59,7 +58,11 @@ public class NodePickerViewModel : ActivatableViewModelBase
|
||||
});
|
||||
|
||||
IsVisible = true;
|
||||
Disposable.Create(() => IsVisible = false).DisposeWith(d);
|
||||
Disposable.Create(() =>
|
||||
{
|
||||
IsVisible = false;
|
||||
TargetPin = null;
|
||||
}).DisposeWith(d);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -102,6 +105,7 @@ public class NodePickerViewModel : ActivatableViewModelBase
|
||||
node.Y = Math.Round(Position.Y / 10d, 0, MidpointRounding.AwayFromZero) * 10d;
|
||||
|
||||
if (TargetPin != null)
|
||||
{
|
||||
using (_nodeEditorService.CreateCommandScope(_nodeScript, "Create node for pin"))
|
||||
{
|
||||
_nodeEditorService.ExecuteCommand(_nodeScript, new AddNode(_nodeScript, node));
|
||||
@@ -114,6 +118,7 @@ public class NodePickerViewModel : ActivatableViewModelBase
|
||||
if (source != null)
|
||||
_nodeEditorService.ExecuteCommand(_nodeScript, new ConnectPins(source, TargetPin));
|
||||
}
|
||||
}
|
||||
else
|
||||
_nodeEditorService.ExecuteCommand(_nodeScript, new AddNode(_nodeScript, node));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user