[cairo] help with cairo_scale

Andrea Cimitan andrea.cimitan at gmail.com
Thu Dec 16 11:11:56 PST 2010


Hi guys, I'm playing with the new gtk-style-context code for a new
theming engine.
I'm trying to grab a cairo_pattern_t, which is given to me in a 1x1
format, so I need to scale it to my context and paint it.
I'm encountering some difficulties, even if it seems simple (might be
late for my brain :))

so, with cairo_t* cr the context, cairo_pattern_t* pat as the pattern,
x, y, width, height the dimensions, I was doing

cairo_rectangle (cr,  x, y, width, height);

cairo_save (cr);

cairo_scale (cr, width, height);
cairo_set_source (cr, pat);
cairo_stroke (cr);

cairo_restore (cr);

but the line width is all messed up, because it's scaled as well :(

what am I doing wrong?
-- 
Andrea Cimitan - http://www.cimitan.com


More information about the cairo mailing list