ICSharpCode.TextEditor.Util.CountTipText.DrawTriangle C# (CSharp) Method

DrawTriangle() public method

public DrawTriangle ( float x, float y, bool flipped ) : void
x float
y float
flipped bool
return void
        void DrawTriangle(float x, float y, bool flipped)
        {
            Brush brush = BrushRegistry.GetBrush(Color.FromArgb(192, 192, 192));
            base.Graphics.FillRectangle(brush, new RectangleF(x, y, triHeight, triHeight));
            float triHeight2 = triHeight / 2;
            float triHeight4 = triHeight / 4;
            brush = Brushes.Black;
            if (flipped) {
                base.Graphics.FillPolygon(brush, new PointF[] {
                                          	new PointF(x,                y + triHeight2 - triHeight4),
                                          	new PointF(x + triWidth / 2, y + triHeight2 + triHeight4),
                                          	new PointF(x + triWidth,     y + triHeight2 - triHeight4),
                                          });

            } else {
                base.Graphics.FillPolygon(brush, new PointF[] {
                                          	new PointF(x,                y +  triHeight2 + triHeight4),
                                          	new PointF(x + triWidth / 2, y +  triHeight2 - triHeight4),
                                          	new PointF(x + triWidth,     y +  triHeight2 + triHeight4),
                                          });
            }
        }