groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Groff] Re: wrong tpic handling in grodvi output


From: Werner LEMBERG
Subject: [Groff] Re: wrong tpic handling in grodvi output
Date: Sun, 09 Nov 2003 06:58:54 +0100 (CET)

From: "Jin-Hwan Cho" <address@hidden>
Subject: Re: wrong tpic handling in grodvi output
Date: Sat, 8 Nov 2003 14:31:42 +0900

> The BUG was not related to this conversion. Instead it was found in
> the algorithm converting arc to cubic bezier curve. More
> specifically,
> 
> groffpic.dvi contains the special command "ar 0 0 250 250 2.940317
> -2.940317".  On the other hand, the corresponding special command in
> texpic.dvi is "ar 250 250 250 250 -3.341593 -2.941593".
> 
> Note that the start angle > the end angle in groffpic.dvi, but not
> in texpic.dvi.
> 
> Actually the original tpic.c could not control the case when the
> start angle the end angle.  It is the BUG what I found from your
> example.
> 
> Patching this BUG is simple. Around line 260 in tpic.c, change as follows:
> 
> === Original Code ===
>     #define MAX_ANG_STEP 1.0
>     nsteps = (int) ((ea-sa)/MAX_ANG_STEP) + 1;
> 
> === Patched Code ===
>     #define MAX_ANG_STEP 1.0
>     if (ea - sa < 0) sa -= 2 * 3.14159265358;
>     nsteps = (int) ((ea-sa)/MAX_ANG_STEP) + 1;

Hmm, I rather suggest

  while (ea - sa < 0) sa -= 2 * 3.14159265358;

> The CVS repository of DVIPDFMx was changed.  But I have no idea on
> the original DVIPDFM 0.13.2c, because it is still maintained by Mark
> Wicks.

Well, I'll change the GNU pic code to avoid such cases.

Thanks for the analysis and the fix!


    Werner

reply via email to

[Prev in Thread] Current Thread [Next in Thread]