示例#1
0
        public static RenderNode ConvertFromNode(Node root)
        {
            RenderNode newNode = MakeNode(root, 0, 0);

            newNode.isRoot = true;
            newNode.EstimateXBounds();
            newNode.Arrange();
            newNode.ApplyXOffset();

            return(newNode);
        }
示例#2
0
        private void EstimateXBounds()
        {
            if (left != null)
            {
                left.EstimateXBounds();
                MergeBounds(left, false);
            }

            if (right != null)
            {
                right.EstimateXBounds();
                MergeBounds(right, false);
            }

            if (xMin == -1 || xMin > x)
            {
                xMin = x;
            }

            if (xMax == -1 || xMax < x)
            {
                xMax = x;
            }
        }