ZForge.Controls.TreeViewAdv.Tree.NodeControls.NodeControl.GetBounds C# (CSharp) Method

GetBounds() protected method

protected GetBounds ( TreeNodeAdv node, DrawContext context ) : Rectangle
node TreeNodeAdv
context DrawContext
return System.Drawing.Rectangle
        protected virtual Rectangle GetBounds(TreeNodeAdv node, DrawContext context)
        {
            Rectangle r = context.Bounds;
            Size s = GetActualSize(node, context);
            Size bs = new Size(r.Width - LeftMargin, Math.Min(r.Height, s.Height));
            switch (VerticalAlign)
            {
                case VerticalAlignment.Top:
                    return new Rectangle(new Point(r.X + LeftMargin, r.Y), bs);
                case VerticalAlignment.Bottom:
                    return new Rectangle(new Point(r.X + LeftMargin, r.Bottom - s.Height), bs);
                default:
                    return new Rectangle(new Point(r.X + LeftMargin, r.Y + (r.Height - s.Height) / 2), bs);
            }
        }