mirror of
https://github.com/Siccity/xNode.git
synced 2025-12-20 09:16:01 +08:00
Updated Node Editor Preferences window. Better separators. Added additional appearance options. Removed Rounding in GridToWindowPositionNoClipped() (and DrawGrid()) which was originally meant to fix UI Sharpness. But it did not have impact in my case and without it made panning feel much smoother.
60 lines
1.3 KiB
C#
60 lines
1.3 KiB
C#
using System.Collections.Generic;
|
|
|
|
namespace XNode
|
|
{
|
|
[NodeColorHeader(0.2f, 0.2f, 0.2f, 0.5f)]
|
|
[NodeColorBody(0.25f, 0.25f, 0.25f, 0.35f)]
|
|
[CreateNodeMenu("Group")]
|
|
public class NodeGroup : Node
|
|
{
|
|
public int width = 400;
|
|
public int height = 400;
|
|
|
|
public override object GetValue(NodePort port)
|
|
{
|
|
return null;
|
|
}
|
|
|
|
/// <summary> Gets nodes in this group </summary>
|
|
public List<Node> GetNodes()
|
|
{
|
|
var result = new List<Node>();
|
|
foreach (Node node in graph.nodes)
|
|
{
|
|
if (node == this)
|
|
{
|
|
continue;
|
|
}
|
|
|
|
if (node == null)
|
|
{
|
|
continue;
|
|
}
|
|
|
|
if (node.position.x < position.x)
|
|
{
|
|
continue;
|
|
}
|
|
|
|
if (node.position.y < position.y)
|
|
{
|
|
continue;
|
|
}
|
|
|
|
if (node.position.x > position.x + width)
|
|
{
|
|
continue;
|
|
}
|
|
|
|
if (node.position.y > position.y + height + 30)
|
|
{
|
|
continue;
|
|
}
|
|
|
|
result.Add(node);
|
|
}
|
|
|
|
return result;
|
|
}
|
|
}
|
|
} |