[cairo] questions concerning cairo/glitz
Bill Spitzak
spitzak at d2.com
Fri Aug 5 12:05:38 PDT 2005
Keith Packard wrote:
> On Sun, 2005-07-31 at 00:05 -0500, Ryan O'Hara wrote:
>
>
>> cairo_set_source_rgba( cr, 1, 0, 0, 1);
>> cairo_set_line_width(cr, 5);
>> cairo_rectangle(cr, 150, 200, 50, 50);
>> cairo_save(cr);
>> cairo_fill(cr);
>> cairo_restore(cr);
>> cairo_stroke(cr);
>>
>>If i comment out the call to cairo_fill, the everything else seems to
>>work fine. Any help would be greatly appreciated.
>
>
> The current path is no longer part of the gstate, so save/restore
> doesn't preserve it. Check out cairo_fill_preserve
This may be a problem with code translated from other libraries that
expect the behavior. However I certainly think the current Cairo
behavior with paths is much more useful in many cases.
One idea I did in a similar interface was to have fill() not destroy the
path, but instead it sets a flag so that the next lineto() or moveto()
destroys the path. This also eliminates the need for the _preserve()
methods.
Then again it may be inefficient to do it this way.
More information about the cairo
mailing list