DrawDiamond() public méthode

public DrawDiamond ( double x, double y, double size ) : void
x double
y double
size double
Résultat void
 private static void DrawFigure(CairoContextEx gr, double x, double y, Figures figure)
 {
     switch (figure) {
     case Figures.TriangleA:
         gr.DrawEquilateralTriangle (x, y, figure_size);
         break;
     case Figures.TriangleB:
         gr.MoveTo (x, y);
         gr.LineTo (x, y + figure_size);
         gr.LineTo (x + figure_size, y);
         gr.LineTo (x, y);
         gr.Stroke ();
         break;
     case Figures.TriangleC:
         gr.MoveTo (x, y);
         gr.LineTo (x, y + figure_size);
         gr.LineTo (x + figure_size, y + figure_size);
         gr.LineTo (x, y);
         gr.Stroke ();
         break;
     case Figures.Square:
         gr.Rectangle (x, y, figure_size, figure_size);
         gr.Stroke ();
         break;
     case Figures.LongRectangle:
         gr.Rectangle (x, y + figure_size / 2, figure_size, figure_size / 2);
         gr.Stroke ();
         break;
     case Figures.LongRectangleUp:
         gr.Rectangle (x, y, figure_size, figure_size / 2);
         gr.Stroke ();
         break;
     case Figures.Diamon:
         gr.DrawDiamond (x, y, figure_size);
         break;
     case Figures.TriangleD:
         gr.MoveTo (x, y);
         gr.LineTo (x, y + figure_size * 0.7);
         gr.LineTo (x + figure_size * 0.7, y + figure_size * 0.7);
         gr.LineTo (x, y);
         gr.Stroke ();
         break;
     }
 }
        private void DrawFigure(CairoContextEx gr, double x, double y, FigureType fig)
        {
            double space_x, space_y;

            space_x = (rect_w - figure_size) / 2;
            space_y = (rect_h - figure_size) / 2;

            switch (fig) {
            case FigureType.Triangle:
                gr.DrawEquilateralTriangle (x + space_x, y + space_y, figure_size);
                break;
            case FigureType.Rectangle:
                gr.Rectangle (x + space_x, y + space_y, figure_size, figure_size);
                gr.Stroke ();
                break;
            case FigureType.Diamond:
                gr.DrawDiamond (x + space_x, y + space_y, figure_size);
                break;
            case FigureType.Cercle:
                gr.Arc (x + space_x + figure_size / 2, y + space_y + figure_size / 2, figure_size / 2, 0, 2 * Math.PI);
                gr.Stroke ();
                break;
            case FigureType.TriangleWithLine:
                gr.DrawEquilateralTriangle (x + space_x, y + space_y, figure_size);
                gr.MoveTo (x + space_x + figure_size / 2, y + space_y);
                gr.LineTo (x + space_x + figure_size / 2, y + space_y + figure_size);
                gr.Stroke ();
                break;
            case FigureType.RectangleWithLine:
                gr.Rectangle (x + space_x, y + space_y, figure_size, figure_size);
                gr.MoveTo (x + space_x, y + space_y);
                gr.LineTo (x + space_x + figure_size, y + space_y + figure_size);
                gr.MoveTo (x + space_x + figure_size, y + space_y);
                gr.LineTo (x + space_x, y + space_y + figure_size);
                gr.Stroke ();
                break;
            case FigureType.DiamondWithLine:
                gr.DrawDiamond (x + space_x, y + space_y, figure_size);
                gr.MoveTo (x + space_x + figure_size / 2, y + space_y);
                gr.LineTo (x + space_x + figure_size / 2, y + space_y + figure_size);
                gr.Stroke ();
                break;
            case FigureType.CercleWithLine:
                gr.Arc (x + space_x + figure_size / 2, y + space_y + figure_size / 2, figure_size / 2, 0, 2 * Math.PI);
                gr.Stroke ();
                gr.MoveTo (x + space_x + figure_size / 2, y + space_y);
                gr.LineTo (x + space_x + figure_size / 2, y + space_y + figure_size);
                gr.Stroke ();
                break;
            }
        }