System.Drawing.PieChart.PieSlice.GetFittingRectangle C# (CSharp) Method

GetFittingRectangle() private method

Calculates the smallest rectangle into which this pie slice fits.
private GetFittingRectangle ( ) : RectangleF
return System.Drawing.RectangleF
        internal RectangleF GetFittingRectangle()
        {
            RectangleF boundingRectangle = new RectangleF(m_pointStart.X, m_pointStart.Y, 0, 0);
            if ((m_startAngle == 0F) || (m_startAngle + m_sweepAngle >= 360))
                GraphicsUtil.IncludePointX(ref boundingRectangle, m_boundingRectangle.Right);
            if ((m_startAngle <= 90) && (m_startAngle + m_sweepAngle >= 90) || (m_startAngle + m_sweepAngle >= 450))
                GraphicsUtil.IncludePointY(ref boundingRectangle, m_boundingRectangle.Bottom + SliceHeight);
            if ((m_startAngle <= 180) && (m_startAngle + m_sweepAngle >= 180) || (m_startAngle + m_sweepAngle >= 540))
                GraphicsUtil.IncludePointX(ref boundingRectangle, m_boundingRectangle.Left);
            if ((m_startAngle <= 270) && (m_startAngle + m_sweepAngle >= 270) || (m_startAngle + m_sweepAngle >= 630))
                GraphicsUtil.IncludePointY(ref boundingRectangle, m_boundingRectangle.Top);
            GraphicsUtil.IncludePoint(ref boundingRectangle, m_center);
            GraphicsUtil.IncludePoint(ref boundingRectangle, m_centerBelow);
            GraphicsUtil.IncludePoint(ref boundingRectangle, m_pointStart);
            GraphicsUtil.IncludePoint(ref boundingRectangle, m_pointStartBelow);
            GraphicsUtil.IncludePoint(ref boundingRectangle, m_pointEnd);
            GraphicsUtil.IncludePoint(ref boundingRectangle, m_pointEndBelow);
            return boundingRectangle;
        }