[cairo] bug in backend to device transformation
Jonathan Gramain
jonathan.gramain at gmail.com
Wed Sep 12 10:44:16 PDT 2007
Hello everyone
I think I've found a bug in cairo-gstate.c, concerning the matrix
transformation in the method _cairo_gstate_backend_to_user_rectangle, here
is the current code :
cairo_matrix_t matrix_inverse;
cairo_matrix_multiply (&matrix_inverse, &gstate->ctm_inverse,
&gstate->target->device_transform_inverse);
_cairo_matrix_transform_bounding_box (&matrix_inverse,
x1, y1, x2, y2, is_tight);
Shouldn't we first apply the device inverse transform before applying the
CTM inverse? I'm doing some work on a canvas based on libpapyrus, and I
encountered a problem when I tried to draw on a GdkWindow (using
gdk_cairo_create) embedded in a GtkScrolledWindow, and at the same time
applying rotations and scaling on the CTM : the scrolled window moves the
GdkWindow, thus the device transform is a translation on this window, and so
the clipping region was not right, and eventually went outside of the
visible region.
Hope this helps.
Jonathan Gramain
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cairographics.org/archives/cairo/attachments/20070912/27577376/attachment.htm
More information about the cairo
mailing list