bug-groff
[Top][All Lists]
Advanced

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

Re: Possible bug in pic regarding lines and corners


From: Werner LEMBERG
Subject: Re: Possible bug in pic regarding lines and corners
Date: Wed, 09 Jan 2008 13:02:07 +0100 (CET)

> In groff, the .ne, .nw, .se and .sw corners of a line are all placed
> at the start of a line.  I don't have access to the original pic but
> I do have access to the Plan 9 pic which places these four corners
> at the centre of the line.

This behaviour is basically unspecified but see below for Dwight
Aplevich's answer (he is the author of dpic).

> However, since these corners do not make much sense in the context
> of a line, maybe this cannot be considered a bug.

Exactly.


  Werner


======================================================================


1. To state the obvious, any definition of the compass corners (other
   than .start and .end) for the potentially multi-segment linear
   objects line, move, arrow, and spline must be arbitrary because the
   corner points are not unique, even for a single segment.  The
   comment that such arbitrary behavior cannot be considered a bug
   seems correct. One is left only with the Principle of Least
   Astonishment.

2. ATT pic returns the start of a line for corners, the same as gpic.
   Dpic attempts something a bit more elaborate, which is to set the
   coordinates x,y to the start and then loop over the segments of the
   line with the following test for .ne, for example:

     if ((endpos.ypos > y) and (endpos.xpos >=x))
        or ((endpos.ypos >=y) and (endpos.xpos > x))
     then
       begin
         x := endpos.xpos;
         y := endpos.ypos
       end

3. The GNU manual defines compass points only for closed objects but
   I've received emails from new users attempting to apply them to
   open objects, so a few additional words deprecating their use might
   be in order.  I've changed the dpic documentation slightly.




reply via email to

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