[cairo] Re: New API: cairo_surface_get_width/height
Carl Worth
cworth at redhat.com
Thu Jun 8 22:55:42 PDT 2006
On Thu, 08 Jun 2006 23:39:09 -0400, Owen Taylor wrote:
>
> 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?"
I don't think this is really any different from the normal confusion
that results from GTK+'s internal backing store. For example, I know
users run into problems when they extract a Drawable from a GTK+
widget and try to draw to it later. I've seen users ask questions
about this and then learn that they have to be aware about the
internal backing store that GTK+ is doing.
And that's not any fault in GTK+. It's just something the user has to
learn---GTK+ cannot successfully hide the fact that its doing this
buffering.
So similar potential confusion existed before cairo and exists
afterwards. So the GTK+ documentation that explains this should also
mention the device offset that GTK+ is applying to the target surface,
(which the user can actually query with cairo_surface_get_device_offset
and account for the 100 vs. 125 difference you mention above).
And that's not really an argument against get_width/height since the
confusion from using a cairo_get_target surface as a source within
GTK+ can exist already, without the new functions.
-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20060608/99fd607b/attachment.pgp
More information about the cairo
mailing list