NPlot.Grid.DrawGridLines C# (CSharp) Method

DrawGridLines() private method

Does all the work in drawing grid lines.
private DrawGridLines ( Graphics g, PhysicalAxis axis, PhysicalAxis orthogonalAxis, List a, bool horizontal, Pen p ) : void
g Graphics The graphics surface on which to render.
axis PhysicalAxis TODO
orthogonalAxis PhysicalAxis TODO
a List the list of world values to draw grid lines at.
horizontal bool true if want horizontal lines, false otherwise.
p Pen the pen to use to draw the grid lines.
return void
        private void DrawGridLines(
            Graphics g, PhysicalAxis axis, PhysicalAxis orthogonalAxis,
            List<double> a, bool horizontal, Pen p)
        {
            for (int i = 0; i < a.Count; ++i)
            {
                PointF p1 = axis.WorldToPhysical((double)a[i], true);
                PointF p2 = p1;
                PointF p3 = orthogonalAxis.PhysicalMax;
                PointF p4 = orthogonalAxis.PhysicalMin;
                if (horizontal)
                {
                    p1.Y = p4.Y;
                    p2.Y = p3.Y;
                }
                else
                {
                    p1.X = p4.X;
                    p2.X = p3.X;
                }
                // note: casting all drawing was necessary for sane display. why?
                g.DrawLine(p, (int)p1.X, (int)p1.Y, (int)p2.X, (int)p2.Y);
            }
        }