> To add Chord and Pie to the path handling you should add
> PATH_Chord/Pie to graphics/path.c, which will probably call PATH_Arc
> or something.  Treat the path stuff as if it were another graphics
> driver (cf enhmetafiledrv) - in fact I almost converted to one, but
> there are some annoying problems in doing so.  I don't understand what
> you mean about coordinate calculation.

take for instance a pie and an open path, we could call PATH_Arc and two 
times PATH_LineTo. but where do we get the coordinates for these 
PATH_LineTo's ? the helper function X11DRV_DrawArc calculates these because 
it must be able to draw pies. we can calculate them again in graphics/path.c 
or something, but wouldn't it be nicer to calculate these just once, and not 
in the graphics driver ? here's part of the X11DRV_DrawArc helper function 
that calculates the coordinates of the endpoints:

            start_angle=(double)istart_angle*PI/64./180.;
            end_angle=(double)(istart_angle+idiff_angle)*PI/64./180.;
            /* calculate the endpoints and round correctly */
            points[0].x = (int) floor(dc->w.DCOrgX + (right+left)/2.0 +
                    cos(start_angle) * (right-left-width*2+2) / 2. + 0.5);
            points[0].y = (int) floor(dc->w.DCOrgY + (top+bottom)/2.0 -
                    sin(start_angle) * (bottom-top-width*2+2) / 2. + 0.5);
            points[1].x = (int) floor(dc->w.DCOrgX + (right+left)/2.0 +
                    cos(end_angle) * (right-left-width*2+2) / 2. + 0.5);
            points[1].y = (int) floor(dc->w.DCOrgY + (top+bottom)/2.0 -
                    sin(end_angle) * (bottom-top-width*2+2) / 2. + 0.5);
   
by the way, I don't think PATH_Chord/Pie functions are necessary. if chords 
and pies are drawn using using Arc() and LineTo(), they indirectly use 
PATH_Arc and PATH_LineTo and the right stuff is added to an open path. the 
same for PATH_AngleArc.. or am I missing something ?


-- 
Mark Dufour <[EMAIL PROTECTED]>
Kascade <[EMAIL PROTECTED]>


Reply via email to