Re: How can I draw the ellipse without a portion of it, defined by two angles?
Arjen Nienhuis <[email protected]>
| Newsgroups | gmane.comp.lib.cairo |
|---|---|
| Message-ID | <CAG6W84KsBJybYFEM6vOuD077vSHHorknzikA-OQRjR86r8ZH0A@mail.gmail.com> |
On Tue, Oct 11, 2011 at 17:26, Carlo <[email protected]> wrote: > Hi ! How can I draw an ellipse without a portion of it (without a slice)?? > I have a start angle and end angle of the ellipse refered to the centre, > but if I try with: > > * *cairo_save(cr) > cairo_translate(cr,x + width / 2., y + height / 2.); > cairo_scale(cr,1. * (width / 2.), 1. * (height / 2.)); > cairo_arc(cr,0., 0., 1., S_ANGLE, E_ANGLE); > cairo_restore(cr); > cairo_stroke(cr);* > * > the ellipse drawn isn't correct, because in scaling the coords. I scale the angles. > How can I draw the ellipse without a correct portion of it, defined by two angles? > > You can try to use a larger circle with the correct angles as clip path and then draw the complete ellipse. ... cairo_translate(...) cairo_arc(cr, 0, 0, larger_than_ellipse_size_plus_pen_width, S_ANGLE, E_ANGLE) cairo_clip(cr) cairo_scale(...) cairo_arc(cr, 0, 0, 1, 0, 2 * pi) ... I didn't try this... > Thank you, > Carlo > > P.S: Sorry for the double post. > > > -- > cairo mailing list > [email protected] > http://lists.cairographics.org/mailman/listinfo/cairo > -- cairo mailing list [email protected] http://lists.cairographics.org/mailman/listinfo/cairo