mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2025-12-25 02:30:11 +01:00
Look for the headers in -I./include. Make the circle track the width and height of the window dynamically. Remove boring expander example. Add more interesting LCA exmaple. Add some notes about how to use this stuff.
22 lines
454 B
C
22 lines
454 B
C
#include "cairo-tutorial.h"
|
|
|
|
static void
|
|
draw (cairo_t *cr, int width, int height)
|
|
{
|
|
int radius;
|
|
|
|
if (width < height)
|
|
radius = width/2 - 4;
|
|
else
|
|
radius = height/2 - 4;
|
|
|
|
cairo_move_to (cr, width/2 + radius, height/2);
|
|
cairo_arc (cr, width/2, height/2, radius,
|
|
0.0, 2 * M_PI);
|
|
|
|
cairo_set_source_rgb (cr, 0.6, 0.8, 1.0);
|
|
cairo_fill_preserve (cr);
|
|
|
|
cairo_set_source_rgb (cr, 0.0, 0.0, 0.0);
|
|
cairo_stroke (cr);
|
|
}
|