when exporting to ps/eps/pdf (+latex) whitespace at arrow tip
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.
--- transfig/
***************
*** 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[
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[
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+
! clippts[i].y = ROTYC(radius+
i++;
! clippts[i].x = ROTXC(radius+
! clippts[i].y = ROTYC(radius+
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+
! clippts[i].y = ROTYC(radius+
i++;
! clippts[i].x = ROTXC(radius+
! clippts[i].y = ROTYC(radius+
i++;
clippts[i].x = ROTXC(0, maxy);
clippts[i].y = ROTYC(0, maxy);
This is not a bug in xfig but in transfig.