[cairo] Re: New API: cairo_surface_get_width/height

Owen Taylor otaylor at redhat.com
Thu Jun 8 20:39:09 PDT 2006


A further thought here. In the code:

 GdkRectangle rect = { 50, 50, 100, 100 };
 gdk_window_begin_paint (window, &rect);

 cairo_t *cr = gdk_cairo_create(window);

 cairo_surface_t *surface = cairo_get_target(cr);

 [...]

A) What is the result of cairo_surface_get_width/height()
   on 'surface' ? 

B) What is the effect of using 'surface' as a source surface?

Now these are very well defined operations as far as Cairo is 
concerned ... GTK+ creates a 100x100 pixmap internally to backing
store drawing to the window.

But the result is almost certainly not what the user expects.

"I'm drawing to the window ... why does Cairo tell me that
my surface is 100x100 when the window is clearly bigger than
that? And how come I'm drawing at coordinates 125,125 and it's 
showing on the screen?"

					Owen




More information about the cairo mailing list