[cairo] 1px line with (very) different x/y scaling

M Joonas Pihlaja jpihlaja at cc.helsinki.fi
Fri Mar 12 22:03:28 PST 2010


On Sat, 13 Mar 2010, Erik Saule wrote:

> Changing the scale just before the stroke operation (and putting it
> back afterwards) seems to solve the problem. But this looks to me
> closer to a hack than to a solution.

This is the proper way.  I tend to have something like this in a 
function called thin_stroke():

	cairo_save(cr); {
		cairo_identity_matrix(cr);
		cairo_set_line_width(cr, 1);
		cairo_stroke(cr);
	}
	cairo_restore(cr);

There's been an idea kicking around where the pen's matrix is set at 
cairo_set_line_width() time instead of cairo_stroke() time, but it 
hasn't been implemented.

Joonas


More information about the cairo mailing list