[cairo] Dia as a new Cairo testbed

Hans Breuer Hans at Breuer.org
Fri May 28 10:05:28 PDT 2004


At 14:47 25.05.04, Øyvind Kolås wrote:
>* Hans Breuer <Hans at Breuer.org> [040525 02:06]:
> > It would be nice if some Cairo expert could tell me what I'm doing 
> wrong in
> > the plug-in with cairo_arc() and also with drawing alpha images ...
>
>Take a look at http://cairographics.org/samples/arc.html and
>http://cairographics.org/samples/arc_negative.html for explaination of
>the parameters used by the cairo_arc functions.

Thanks for the pointer but there is nothing new with regard to my problem. 
Also I think the snippet should set the arcs starting point to explicit 
avoid some line_to it in _cairo_gstate_arc.

The Dia to Cairo Arcs Conversion is finally sorted out with some more 
negativism ;-)

   /* Dia and Cairo don't agree on arc definitions, so it needs
    * to be converted, i.e. mirrored at the x axis
    */
   cairo_new_path (renderer->cr);
   start.x = center->x + (width / 2.0)  * cos((M_PI / 180.0) * angle1);
   start.y = center->y - (height / 2.0) * sin((M_PI / 180.0) * angle1);
   cairo_move_to (renderer->cr, start.x, start.y);
   a1 = - (angle1 / 180.0) * G_PI;
   a2 = - (angle2 / 180.0) * G_PI;
   //FIXME: to handle width != height some cairo_scale/cairo_translate 
would be needed
   cairo_arc_negative (renderer->cr, center->x, center->y,
                       width > height ? height / 2.0 : width / 2.0, //FIXME 
2nd radius
                       a1, a2);

         Hans
-------- Hans "at" Breuer "dot" Org -----------
Tell me what you need, and I'll tell you how to
get along without it.                -- Dilbert





More information about the cairo mailing list