[cairo] re: 1.3 bug maybe

Robert Gibbs gibbsrc at gmail.com
Fri Jan 26 18:14:17 PST 2007


Reposting since the first message was apparently scrubbed....

Hi,

I am seeing some strange behavior with the cairo context when I create it
using gdk.   I built libgdk-x11-2.0  against cairo 1.3 just to be sure it
wasn't an ABI issue, but I see the problem regardless.

The attached test program demonstrates the problem.

Move another window around over the application window and look at the print
out.

I would expect to see stroke extents of (-1.0, -1.0, 11.0, 11.0)

Instead I see extents that are strangely similar to the coordinates of the
GdkEvent rectangle.

This program works fine with cairo-1.2.4.

Thanks
Bob Gibbs


##################################################
import gtk, cairo

def on_expose(da, event):

    c = da.window.cairo_create()
    c.identity_matrix()
    c.scale(2,2)
    c.new_path()
    c.rectangle(0, 0, 10, 10)
    # Move another window around over this one.
    print c.stroke_extents()
    # !!! What's wrong here?  I should get (-1.0, -1.0, 11.0, 11.0)
    # but I get something that reflects values from the GdkEventExpose
struct

w = gtk.Window()
w.set_size_request (600, 600)

w.connect('delete-event', gtk.main_quit)
da = gtk.DrawingArea()
w.add(da)
da.connect('expose-event', on_expose)

w.show_all()
gtk.main()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/cairo/attachments/20070126/e264b9b4/attachment.html


More information about the cairo mailing list