<html><head><style type="text/css"><!-- DIV {margin:0px} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">So if one of us develop a new cairo function, let's say draw_chord() <br>that achieves the functionnalities below<br>(like drawing an ellipse without touching the transformation matrix)<br>with an additional radius_y parameter like :<br><pre class="programlisting">void cairo_chord(<a href="http://www.cairographics.org/manual/cairo-cairo-t.html#cairo-t">cairo_t</a> *cr,<br>        double xc,<br> double yc,<br> double radius_x,<br> double radius_y,<br> double angle1,<br> double angle2);</pre>Would there be chances that it is accepted as a contrib,<br>and would there be special recommandations to follow ?<br>(i.e: adding a draw_chord_negative() api as well to stay orthogonal with previous arc
api)<br><br>Fabien<br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Message d'origine ----<br>De : Behdad Esfahbod <behdad@behdad.org><br>À : Fabien Costantini <fab672000@yahoo.fr><br>Envoyé le : Lundi, 10 Juillet 2006, 5h01mn 11s<br>Objet : Re: [cairo] cairo arc drawing limitation<br><br><div>On Mon, 2006-07-10 at 06:21 -0400, Fabien Costantini wrote:<br>> Hi I just dived in documentation, and noticed that the only way to get an ellipse<br>> path drawn seems to use the transformation matrix.<br>> <br>> This approach, though at first sight elegant, seems quite limitative to me, in effect :<br>> <br>> 1. To achieve a scale, you have to know what is the current scaling policies, in particular, when dimensions are not in the [0,1] space but in standard pixel width,height coordinates; it implies that you keep track of the width and height of your current drawing surface to achieve aa
correct scale. Also a matrix translate accumulation has to be done (and possibly the inverse translate after the operation)<br>> <br>> 2. most of the time you have to save and restore the context, that could be be avoided<br>> <br>> Wouldn't it be faster to run and simpler to code <br>> just to add one parameter to specify a height possibly different from the width in cairo_arc()<br>> andd cairo_negative_arc() ?<br>> <br>> It would then be more orthogonal with other path construction API like cairo_rectangle()<br>> (there is fortunately no need to use a cairo_square() function and a transformation matrix to draw a rectangle)<br>> <br>> Any thoughts ?<br><br>I tend to agree. It's just too hard to draw a rectangle with rounded<br>corners that are parts of an ellipse.<br><br>One more thing that comes to mind is the pen width discussion. Without<br>locked pen width, it's a bit limiting to use cairo_scale to
draw<br>ellipses.<br><br>behdad<br><br>> Fabien<br></div></div><br></div></div></body></html>