<div class="gmail_quote">On Tue, Oct 11, 2011 at 17:26, Carlo <span dir="ltr"><<a href="mailto:defrag1986@gmail.com">defrag1986@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div bgcolor="#FFFFFF" text="#000000"><div><div></div><div class="h5">
Hi ! How can I draw an ellipse without a portion of it (without a
slice)??<br>
I have a start angle and end angle of the ellipse refered to the
centre, but if I try with:<br>
</div></div><pre><div><div></div><div class="h5"><i>        </i>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);<i>
</i></div></div>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? </pre></div></blockquote><div class="gmail_quote"><br></div>You can try to use a larger circle with the correct angles as clip path and then draw the complete ellipse.<br>
<div><br></div><div><span style="font-family: monospace; white-space: pre; background-color: transparent; ">...</span></div><div><span style="font-family: monospace; white-space: pre; background-color: transparent; ">cairo_translate(...)</span></div>
<div><span style="font-family: monospace; white-space: pre; background-color: transparent; ">cairo_arc(cr, 0, 0, larger_than_ellipse_size_plus_pen_width</span><span style="background-color: transparent; font-family: monospace; white-space: pre; ">, S_ANGLE, E_ANGLE)</span></div>
<div><div><span style="font-family: monospace; white-space: pre; background-color: transparent; ">cairo_clip(cr)</span></div></div><div><span style="font-family: monospace; white-space: pre; background-color: transparent; ">cairo_scale(...)</span></div>
<div><span style="font-family: monospace; white-space: pre; background-color: transparent; ">cairo_arc(</span><span style="font-family: monospace; white-space: pre; ">cr, 0, 0, 1, 0, 2 * pi</span><span style="font-family: monospace; white-space: pre; background-color: transparent; ">)</span></div>
<div><span style="font-family: monospace; white-space: pre; background-color: transparent; ">...</span></div><div><br></div><div>I didn't try this...</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div bgcolor="#FFFFFF" text="#000000"><pre>Thank you,
Carlo
P.S: Sorry for the double post.
</pre>
</div>
<br>--<br>
cairo mailing list<br>
<a href="mailto:cairo@cairographics.org">cairo@cairographics.org</a><br>
<a href="http://lists.cairographics.org/mailman/listinfo/cairo" target="_blank">http://lists.cairographics.org/mailman/listinfo/cairo</a><br></blockquote></div><br>