[cairo] strange bug(?) in cairo2 1.12.16-0ubuntu2

Patrik Nilsson nipatriknilsson at gmail.com
Sun Feb 16 15:19:56 CET 2014


Hi All,

I'm rendering to an A1 surface. First I fill the surface (with
cairo_fill_preserv) and then make a frame (cairo_stroke). It is later
going to be used as a mask.

The stroke is always drawn regardless of the shape, but cairo_fill (or
cairo_fill_preserv) only fills the surface if it is non-rectangular.

This doesn't work in package "cairo2 1.12.16-0ubuntu2", but it worked in
previous versions of cairo. The package in Debian 7 works cairo_fill. 
Is there a bug introduced?

    //Points to be drawn is in a list called areascreen.

    //These lines are just for a workaround if the shape is rectangular
    GdkPoint *first = areascreen.GetHead ();
    if ( first != NULL )
    {
        GdkPoint point;
        memcpy ( &point, first, sizeof ( GdkPoint ) );
        point.x ++; //some strange bug in cairo
        point.y ++; //some strange bug in cairo

        areascreen.AddTail ( &point );
    }

    /////

    cairo_set_operator ( cr, op );

    /////

    cairo_new_path ( cr );

    GdkPoint *p = areascreen.GetHead ();
    while ( p != 0 )
    {
        if ( p == areascreen.GetHead () )
        {
            cairo_move_to ( cr, p->x, p->y );
        }
        else
        {
            cairo_line_to ( cr, p->x, p->y );
        }

        p = areascreen.GetNext ( p );
    }

    cairo_close_path ( cr );

    cairo_set_source_rgba ( cr, rfill, gfill, bfill, afill );
    cairo_fill_preserve ( cr );

    ////

    cairo_set_line_width ( cr, 1 );

    cairo_set_source_rgba ( cr, rframe, gframe, bframe, aframe );
    cairo_stroke ( cr );

Any help is welcome!

Best regards,
Patrik

-- 
PGP-key fingerprint: 1B30 7F61 AF9E 538A FCD6  2BE7 CED7 B0E4 3BF9 8D6C



More information about the cairo mailing list