コード例 #1
0
        private void DrawGraph(bool selected)
        {
            if (Graph == null)
            {
                return;
            }

            foreach (var node in Graph.Nodes.Where(x => selected == Selector.IsSelected(x)))
            {
                TinyGUI.DrawNode(node, selected, Graph.HasInEdge(node), Graph.HasOutEdge(node));
            }

            foreach (var edge in Graph.Edges.Where(x => selected == Selector.IsSelected(x)))
            {
                var @out = TinyGUI.GetOutRect(Graph.GetNode(edge.Out));
                var @in  = TinyGUI.GetInRect(Graph.GetNode(edge.In));
                if (TinyGUI.DrawEdge(@out, @in, selected))
                {
                    Selector.AddSingle(edge);
                }
            }
        }