Re: Arcs appear thicker than straight lines?
[email protected] (Søren Sandmann)
| Newsgroups | gmane.comp.lib.cairo |
|---|---|
| Message-ID | <[email protected]> |
Yifan Yu <[email protected]> writes: > Hi, I'm trying to draw a simple rounded rectangle with four little arcs, using > one of the methods described here. The result is fine, with just one problem: > the arc lines appear thicker in line width than the straight lines (estimated > as twice as thick, while the straight lines are thin and sharp). This is > especially annoying when the radius of the arcs is small. Is it possible to > make the arc lines as sharp and thin as the straight lines? One thing that can cause this is if you are drawing in such a way that half the straight line is sticking outside the surface you are drawing on, which can happen if you are using coordinates of 0.0 with a line width of 1.0. In cairo, (0, 0) refers to the top left corner of the top left pixel of the surface, and (0.5, 0.5) refers to the center of the top left pixel. So to draw a rounded border with line width 1 on such a surface, you want want to do something like cairo_set_line_width (1) cairo_move_to (0.5, 10) cairo_curve_to (..., 10, 0.5); cairo line_to (width, 0.5) ... Ie., using 0.5 and not 0.0. See also http://cairographics.org/FAQ/#sharp_lines Soren -- cairo mailing list [email protected] http://lists.cairographics.org/mailman/listinfo/cairo