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

List:       cairo
Subject:    Re: [cairo] Question about cairo_fill_preserve
From:       Dirk_Schönberger <dirk.schoenberger () sz-online ! de>
Date:       2008-01-04 20:36:54
Message-ID: 09d301c84f11$913b9aa0$14b2a8c0 () rincewind
[Download RAW message or body]

> If I use cairo_line_to(), and cairo_move_to() to draw something like this:
> |       |
> ---------
> |       |
> ---------

> I see it when i use 'cairo_stroke_preserve()'

> But what if I want to fill the bottom rectangle , i try using
> cairo_fill_preserve(), but nothing appear.

From your code I see that you use to many calls to cairo_moveto
The item you want to have filled should be created with one call to
cairo_moveto, the rest should only be cairo_lineto.
The first cairo_moveto of your path definition also defines the endpoint,
i.e. the point wich is used to close the element in order to fill.

For the given points

A            D
   |       |
B --------- E
   |       |
C --------- F

I _think_ the correct sequence should be

moveto (A)
lineto (B)
lineto (C)
lineto (F)
lineto (E)
lineto (D)

// needed to only fill the BECF rectangle
lineto (E)
lineto (B)

closepath


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