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

Erik Saule godrik at mandragor.org
Sat Mar 13 09:43:44 PST 2010


Ok, thank you

On Sat, Mar 13, 2010 at 08:03:28AM +0200, M Joonas Pihlaja wrote:
> 
> 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

-- 
L'analyse se fait par cas, comme la veste.[Erik2008]



More information about the cairo mailing list