GitUI.RevisionGrid.DrawArrow C# (CSharp) Method

DrawArrow() private method

private DrawArrow ( Graphics graphics, float x, float y, float rowHeight, Color color, bool filled ) : void
graphics System.Drawing.Graphics
x float
y float
rowHeight float
color Color
filled bool
return void
        private void DrawArrow(Graphics graphics, float x, float y, float rowHeight, Color color, bool filled)
        {
            const float horShift = 4;
            const float verShift = 3;
            float height = rowHeight - verShift * 2;
            float width = height / 2;

            var points = new[]
                                 {
                                     new PointF(x + horShift, y + verShift),
                                     new PointF(x + horShift + width, y + verShift + height/2),
                                     new PointF(x + horShift, y + verShift + height),
                                     new PointF(x + horShift, y + verShift)
                                 };

            if (filled)
            {
                using (var solidBrush = new SolidBrush(color))
                    graphics.FillPolygon(solidBrush, points);
            }
            else
            {
                using (var pen = new Pen(color))
                    graphics.DrawPolygon(pen, points);
            }
        }
RevisionGrid