#define WIDTH 750 #define HEIGHT 360 #include "cairo-tutorial.h" static void draw (cairo_t *cr, int width, int height) { double x1 = 0, y1 = 0, x2 = 0, y2 = 0; cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND); cairo_set_line_join (cr, CAIRO_LINE_JOIN_ROUND); cairo_set_line_width (cr, 20); cairo_move_to (cr, 0, height/2); cairo_line_to (cr, width, (height/2 #ifdef WORKAROUND_BUG + 1 #endif )); cairo_fill_extents (cr, &x1, &y1, &x2, &y2); printf("fill: x1=%f y1=%f x2=%f y2=%f\n", x1, y1, x2, y2); cairo_stroke_extents (cr, &x1, &y1, &x2, &y2); printf("stroke: x1=%f y1=%f x2=%f y2=%f\n", x1, y1, x2, y2); cairo_stroke (cr); }