[cairo] const-ness fixes for transform_distance and transform_point

Keith Bauer OneSadCookie at paradise.net.nz
Tue May 10 13:37:45 PDT 2005


>>     cairo_scaled_font_create (face, font_matrix,
>>                   cairo_get_matrix (cr));
>
> I'm not entirely comfortable with that. The problem is that  
> although the
> matrix is const to the API user, its contents can change over time.

I agree, this seems like a recipe for disaster.

It strikes me that you can get close to the desired syntax without  
breaking the desired semantics by behaving a bit like getcwd, and  
returning the pointer to your output parameter:

cairo_matrix_t *cairo_get_matrix(cairo_t *cr, cairo_matrix_t *matrix);

Perhaps that would satisfy everyone?

-Keith




More information about the cairo mailing list