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

InitializePieSlice() private method

Initializes pie bounding rectangle, pie height, corners coordinates and brushes used for rendering.
private InitializePieSlice ( float xBoundingRect, float yBoundingRect, float widthBoundingRect, float heightBoundingRect, float sliceHeight ) : void
xBoundingRect float /// x-coordinate of the upper-left corner of the rectangle that is /// used to draw the top surface of the pie slice. ///
yBoundingRect float /// y-coordinate of the upper-left corner of the rectangle that is /// used to draw the top surface of the pie slice. ///
widthBoundingRect float /// Width of the rectangle that is used to draw the top surface of /// the pie slice. ///
heightBoundingRect float /// Height of the rectangle that is used to draw the top surface of /// the pie slice. ///
sliceHeight float /// Height of the pie slice. ///
return void
        private void InitializePieSlice(float xBoundingRect, float yBoundingRect, float widthBoundingRect, float heightBoundingRect, float sliceHeight)
        {
            // stores bounding rectangle and pie slice height
            m_boundingRectangle = new RectangleF(xBoundingRect, yBoundingRect, widthBoundingRect, heightBoundingRect);
            m_sliceHeight = sliceHeight;
            // recalculates start and sweep angle used for rendering
            m_startAngle = TransformAngle(m_actualStartAngle);
            m_sweepAngle = m_actualSweepAngle;
            if (m_sweepAngle % 180 != 0F)
                m_sweepAngle = TransformAngle(m_actualStartAngle + m_actualSweepAngle) - m_startAngle;
            if (m_sweepAngle < 0)
                m_sweepAngle += 360;
            // recreates brushes
            CreateSurfaceBrushes(m_surfaceColor, m_shadowStyle);
            // calculates center and end points on periphery
            float xCenter = xBoundingRect + widthBoundingRect / 2;
            float yCenter = yBoundingRect + heightBoundingRect / 2;
            m_center = new PointF(xCenter, yCenter);
            m_centerBelow = new PointF(xCenter, yCenter + sliceHeight);
            m_pointStart = PeripheralPoint(xCenter, yCenter, widthBoundingRect / 2, heightBoundingRect / 2, m_actualStartAngle);
            m_pointStartBelow = new PointF(m_pointStart.X, m_pointStart.Y + sliceHeight);
            m_pointEnd = PeripheralPoint(xCenter, yCenter, widthBoundingRect / 2, heightBoundingRect / 2, m_actualStartAngle + m_actualSweepAngle);
            m_pointEndBelow = new PointF(m_pointEnd.X, m_pointEnd.Y + sliceHeight);
            InitializeSides();
        }