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