when exporting to ps/eps/pdf (+latex) whitespace at arrow tip

Bug #52738 reported by marquito
4
Affects Status Importance Assigned to Milestone
transfig (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: xfig

I discovered, when exporting to ps/eps/pdf (+latex) with xfig/transfig 3.2.5 there is some whitespace introduced between the arrow tips and the boxes.

A friend of mine reported this to the author and got following reply:

"That bug was just fixed recently in transfig, but hasn't been released yet.
I have attached a patch file to fix the problem. If you need help patching
the source, please write again and I'll explain the process.

Thanks for using xfig."

file: patch.arrows

This fixes the bug where arrow heads fell short of the intended endpoint
This is to be applied to 3.2.5_alpha7 to make alpha8

*** transfig.3.2.5_alpha7/fig2dev/bound.c Thu Oct 27 09:08:03 2005
--- transfig/fig2dev/bound.c Wed Nov 23 15:45:47 2005
***************
*** 824,830 ****
      int xa, ya, xs, ys;
      double wd = (double) arrow->wid;
      double len = (double) arrow->ht;
! double th = arrow->thickness;
      double radius;
      double angle, init_angle, rads;
      double fix_x, fix_y;
--- 824,830 ----
      int xa, ya, xs, ys;
      double wd = (double) arrow->wid;
      double len = (double) arrow->ht;
! double thk;
      double radius;
      double angle, init_angle, rads;
      double fix_x, fix_y;
***************
*** 852,861 ****
         line because of the sharp point (miter join) */
      tipmv = arrow_shapes[indx].tipmv;
      lpt = 0.0;
      if (tipmv > 0.0)
! lpt = th / (2.0 * sin(atan(wd / (tipmv * len))));
      else if (tipmv == 0.0)
! lpt = th / 2.0; /* types which have blunt end */
     /* (Don't adjust those with tipmv < 0) */

      /* alpha is the angle the line is relative to horizontal */
--- 852,864 ----
         line because of the sharp point (miter join) */
      tipmv = arrow_shapes[indx].tipmv;
      lpt = 0.0;
+ thk = (arrow->thickness <= THICK_SCALE) ?
+ 0.5* arrow->thickness :
+ arrow->thickness - THICK_SCALE;
      if (tipmv > 0.0)
! lpt = thk / (2.0 * sin(atan(wd / (tipmv * len))));
      else if (tipmv == 0.0)
! lpt = thk / 2.0; /* types which have blunt end */
     /* (Don't adjust those with tipmv < 0) */

      /* alpha is the angle the line is relative to horizontal */
***************
*** 932,953 ****
   /* set clipping to a box at least as large as the line thickness
      or diameter of the circle, whichever is larger */
   /* 4 points in clip box */
! miny = MIN(-halfthick, -radius-th/2.0);
! maxy = MAX( halfthick, radius+th/2.0);

   i=0;
   /* start at new endpoint of line */
! clippts[i].x = ROTXC(0, -radius-th/2.0);
! clippts[i].y = ROTYC(0, -radius-th/2.0);
   i++;
   clippts[i].x = ROTXC(0, miny);
   clippts[i].y = ROTYC(0, miny);
   i++;
! clippts[i].x = ROTXC(radius+th/2.0, miny);
! clippts[i].y = ROTYC(radius+th/2.0, miny);
   i++;
! clippts[i].x = ROTXC(radius+th/2.0, maxy);
! clippts[i].y = ROTYC(radius+th/2.0, maxy);
   i++;
   clippts[i].x = ROTXC(0, maxy);
   clippts[i].y = ROTYC(0, maxy);
--- 935,956 ----
   /* set clipping to a box at least as large as the line thickness
      or diameter of the circle, whichever is larger */
   /* 4 points in clip box */
! miny = MIN(-halfthick, -radius-thk/2.0);
! maxy = MAX( halfthick, radius+thk/2.0);

   i=0;
   /* start at new endpoint of line */
! clippts[i].x = ROTXC(0, -radius-thk/2.0);
! clippts[i].y = ROTYC(0, -radius-thk/2.0);
   i++;
   clippts[i].x = ROTXC(0, miny);
   clippts[i].y = ROTYC(0, miny);
   i++;
! clippts[i].x = ROTXC(radius+thk/2.0, miny);
! clippts[i].y = ROTYC(radius+thk/2.0, miny);
   i++;
! clippts[i].x = ROTXC(radius+thk/2.0, maxy);
! clippts[i].y = ROTYC(radius+thk/2.0, maxy);
   i++;
   clippts[i].x = ROTXC(0, maxy);
   clippts[i].y = ROTYC(0, maxy);

Revision history for this message
Roland Rosenfeld (roland) wrote :

This is not a bug in xfig but in transfig.

Revision history for this message
Roland Rosenfeld (roland) wrote :

The above patch is now incorporated in Debian version 1:3.2.5-alpha7-3.

Revision history for this message
Jérôme Guelfucci (jerome-guelfucci-deactivatedaccount) wrote :

Thank you for your bug report. Do you still have this issue with the latest release of Ubuntu ?

Changed in transfig:
importance: Undecided → Low
status: Unconfirmed → Needs Info
Revision history for this message
Jérôme Guelfucci (jerome-guelfucci-deactivatedaccount) wrote :

Any news on this ?

Revision history for this message
marquito (marquito) wrote :

i upgraded to feisty and it works, however i do not know whether this was fixed in edgy

Revision history for this message
Jérôme Guelfucci (jerome-guelfucci-deactivatedaccount) wrote :

As this is fixed in Feisty I'm marking this as fixed. Thank you.

Changed in transfig:
status: Incomplete → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.