Hi cairomailing list,
I got a problem, when I use this code :
        s=cairo_xlib_surface_create(dpy, wndw.frame, DefaultVisual(dpy, 0), 
640, 480);
        c=cairo_create(s);
        p=cairo_pattern_create_linear(10.10,0.10,0.0,450.0);
        cairo_pattern_add_color_stop_rgba(p,0,1,0,0,1);
        cairo_pattern_add_color_stop_rgba(p,1,0,1,0,1);
        cairo_rectangle(c,0,0,640,480);
        cairo_set_source(c,p);
        cairo_fill(c);
no rectangle is drawn. If I use this one :
        s=cairo_xlib_surface_create(dpy, wndw.frame, DefaultVisual(dpy, 0), 
640, 480);
        c=cairo_create(s);
        p=cairo_pattern_create_linear(10.10,0.10,0.0,450.0);
        cairo_pattern_add_color_stop_rgba(p,0,1,0,0,1);
        cairo_pattern_add_color_stop_rgba(p,1,1,0,0,1);
        cairo_rectangle(c,0,0,640,480);
        cairo_set_source(c,p);
        cairo_fill(c);I got a red rectangle.My code is almost the same that one 
here : http://cairographics.org/samples/gradient/ , I tried this :
        // added by me
         s=cairo_xlib_surface_create(dpy, wndw.frame, DefaultVisual(dpy, 0), 
640, 480);
        c=cairo_create(s);
        // from the link
        pat = cairo_pattern_create_linear (0.0, 0.0,  0.0, 256.0);
        cairo_pattern_add_color_stop_rgba (pat, 1, 0, 0, 0, 1);
        cairo_pattern_add_color_stop_rgba (pat, 0, 1, 1, 1, 1);
        cairo_rectangle (c, 0, 0, 256, 256);
        cairo_set_source (c, pat);
        cairo_fill (c);
        cairo_pattern_destroy (pat);
no rectangle is drawn. And like before, if I use the code just above with two 
times the same RGBA as patern ,I got a rectangle.
So can somebody explains to me what's going on ?

-Nicoo
_______________________________________________
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.x.org/mailman/listinfo/xorg
Your subscription address: arch...@mail-archive.com

Reply via email to