SpaceSim.Orbits.OrbitTrace.RenderStart C# (CSharp) Method

RenderStart() private static method

private static RenderStart ( Graphics graphics, RectangleD cameraBounds, IMapRenderable orbitingBody, DVector2 start ) : void
graphics System.Drawing.Graphics
cameraBounds VectorMath.RectangleD
orbitingBody IMapRenderable
start VectorMath.DVector2
return void
        private static void RenderStart(Graphics graphics, RectangleD cameraBounds, IMapRenderable orbitingBody, DVector2 start)
        {
            double visibility = orbitingBody.Visibility(cameraBounds);

            if (visibility < 1)
            {
                PointF iconPoint = RenderUtils.WorldToScreen(start, cameraBounds);

                var iconBounds = new RectangleF(iconPoint.X - 5, iconPoint.Y - 5, 10, 10);

                var iconColor = Color.FromArgb((int)((1 - visibility) * 255),
                                               orbitingBody.IconColor.R,
                                               orbitingBody.IconColor.G,
                                               orbitingBody.IconColor.B);

                graphics.FillEllipse(new SolidBrush(iconColor), iconBounds);
            }
        }