Upload Tizen2.0 source
[framework/graphics/cairo.git] / doc / tutorial / src / circle.c
1 #include "cairo-tutorial.h"
2
3 static void
4 draw (cairo_t *cr, int width, int height)
5 {
6     int radius;
7
8     if (width < height)
9         radius = width/2 - 4;
10     else
11         radius = height/2 - 4;
12
13     cairo_move_to (cr, width/2 + radius, height/2);
14     cairo_arc (cr, width/2, height/2, radius,
15                0.0, 2 * M_PI);
16
17     cairo_set_source_rgb (cr, 0.6, 0.8, 1.0);
18     cairo_fill_preserve (cr);
19
20     cairo_set_source_rgb (cr, 0.0, 0.0, 0.0);
21     cairo_stroke (cr);
22 }