[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cairo
Subject:    Re: [cairo] Is Cairo able to fit my needs?
From:       Dirk_Schönberger <dirk.schoenberger () sz-online ! de>
Date:       2007-10-04 17:55:05
Message-ID: 008401c806af$b5acbfe0$14b2a8c0 () rincewind
[Download RAW message or body]

> I tried your suggestion with CAIRO_FILL_RULE_EVEN_ODD and
> CAIRO_FILL_RULE_WINDING. Two black squares overlapping each other, each in
a
> single path:

The fill rule works when the path is rendered, not on the surfaces.
You should try to paint both sub-paths in one action, i.e.

cairo_new_sub_path( cr);
cairo_line_to( cr, 0, 0 );
cairo_line_to( cr, 0, 1000 );
cairo_line_to( cr, 1000, 1000 );
cairo_line_to( cr, 1000, 0 );
cairo_line_to( cr, 0, 0 );
cairo_close_path( cr );

cairo_new_sub_path( cr);
cairo_line_to( cr, 200, 200 );
cairo_line_to( cr, 200, 400 );
cairo_line_to( cr, 400, 400 );
cairo_line_to( cr, 400, 200 );
cairo_line_to( cr, 200, 200 );
cairo_close_path( cr );

cairo_set_source_rgba( cr, 0, 0, 0, 1);
cairo_set_fill_rule(cr, CAIRO_FILL_RULE_EVEN_ODD);
cairo_fill (cr);

Regards
DIrk


_______________________________________________
cairo mailing list
cairo@cairographics.org
http://lists.cairographics.org/mailman/listinfo/cairo
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic