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();
}