[cairo] cairo_stroke_extents() with transformation matrix

Andreas Falkenhahn andreas at airsoftsoftwair.de
Mon Feb 1 08:35:25 PST 2010


Hi,

how can I get cairo_stroke_extents() to take the current transformation matrix
into account? I.e. please consider the following code:

// scale * 2 on both axes
cairo_matrix_init(&m, 2, 0, 0, 2, 0, 0);

cairo_set_matrix(cr, &m);
cairo_new_path(cr);
cairo_rectangle(cr, 0, 0, 320, 240);	
cairo_stroke_extents(cr, &x1, &y1, &x2, &y2);

I'd expect that cairo_stroke_extents() would return something in the range
of roughly 640 for x2 and roughly 480 for y2. Instead, it simply returns about
320 for x2 and about 240 for y2-- just as if there was no transformation at all.

Is there a way to get cairo_stroke_extents() take the current transformation
matrix into account?

Thanks,

Andreas



More information about the cairo mailing list