[cairo-bugs] [Bug 24442] New: New cairo_path_t method - cairo_rounded_rectangle

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sat Oct 10 08:09:13 PDT 2009


http://bugs.freedesktop.org/show_bug.cgi?id=24442

           Summary: New cairo_path_t method - cairo_rounded_rectangle
           Product: cairo
           Version: 1.8.8
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: general
        AssignedTo: cworth at cworth.org
        ReportedBy: kdekorte at yahoo.com
         QAContact: cairo-bugs at cairographics.org


Please add the following cairo_path_t method to cairo.

void cairo_rounded_rectangle(cairo_t *cr, double x, double y, double width,
double height, double radius)
{

        cairo_new_sub_path(cr);
        cairo_arc(cr, x + radius, y + height - radius, radius, 90.0 * (M_PI /
180.0), 180.0 * (M_PI / 180.));
        cairo_line_to(cr, x, y + radius);
        cairo_new_sub_path(cr);
        cairo_arc(cr, x + radius, y + radius, radius, 180.0 * (M_PI / 180.0),
270.0 * (M_PI / 180.));
        cairo_line_to(cr, x + width - radius, y);
        cairo_new_sub_path(cr);
        cairo_arc(cr, x + width - radius, y + radius, radius, 270.0 * (M_PI /
180.0), 360.0 * (M_PI / 180.));
        cairo_line_to(cr, x + width, y + height - radius);
        cairo_new_sub_path(cr);
        cairo_arc(cr, x + width - radius, y + height - radius, radius, 360.0 *
(M_PI / 180.0), 90.0 * (M_PI / 180.));
        cairo_line_to(cr, x + radius, y + height);

}


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the cairo-bugs mailing list