Index: src/cairo.c =================================================================== RCS file: /cvs/cairo/cairo/src/cairo.c,v retrieving revision 1.126 diff -u -r1.126 cairo.c --- src/cairo.c 19 Aug 2005 06:10:41 -0000 1.126 +++ src/cairo.c 19 Aug 2005 15:03:14 -0000 @@ -1261,15 +1261,19 @@ double x, double y, double width, double height) { + double x2 = x+width; + double y2 = y+width; + if (cr->status) { _cairo_set_error (cr, cr->status); return; } + /* don't use cairo_rel_line_to to avoid rounding errors */ cairo_move_to (cr, x, y); - cairo_rel_line_to (cr, width, 0); - cairo_rel_line_to (cr, 0, height); - cairo_rel_line_to (cr, -width, 0); + cairo_line_to (cr, x2, y); + cairo_line_to (cr, x2, y2); + cairo_line_to (cr, x, y2); cairo_close_path (cr); }