summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvipsk/drawPS.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/dvipsk/drawPS.c')
-rw-r--r--Build/source/texk/dvipsk/drawPS.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/Build/source/texk/dvipsk/drawPS.c b/Build/source/texk/dvipsk/drawPS.c
index b23a75e27ee..c010697020b 100644
--- a/Build/source/texk/dvipsk/drawPS.c
+++ b/Build/source/texk/dvipsk/drawPS.c
@@ -100,19 +100,21 @@ char RCSid[] =
/* convert from tpic units to PS units */
#define PixRound(a,b) zPixRound((a),(b))
-#define convPS(x) PixRound((x),convRESOLUTION)
-#define convVPS(x) PixRound((x),convVRESOLUTION)
+#define convPS(x) PixRound((x), dir ? convVRESOLUTION : convRESOLUTION)
+#define convVPS(x) PixRound((x), dir ? convRESOLUTION : convVRESOLUTION)
+#define ConvPS(x) PixRound((x), convRESOLUTION)
+#define ConvVPS(x) PixRound((x), convVRESOLUTION)
/* convert from tpic locn to abs horiz PS locn */
-#define hconvPS(x) (hh + convPS(x))
+#define hconvPS(x) dir ? (vv + ConvVPS(x)) : (hh + ConvPS(x))
/* convert from tpic locn to abs vert PS locn */
-#define vconvPS(x) (vv + convVPS(x))
+#define vconvPS(x) dir ? (-hh + ConvPS(x)) : (vv + ConvVPS(x))
/* convert to degrees */
#define convDeg(x) (360*(x)/(2*3.14159265358979))
/* if PostScript had splines, i wouldnt need to store the path */
-#define MAXPATHS 600 /* maximum number of path segments */
-#define NONE 0 /* for shading */
+#define MAXPATHS 6000 /* maximum number of path segments */
+#define NONE 0 /* for shading */
#define BLACK 1 /* for shading */
#define GRAY 2 /* MJ; for shading */
#define WHITE 3 /* for shading */
@@ -200,15 +202,15 @@ arc(char *cp, int invis)
doubleout(hconvPS(xc));
doubleout(vconvPS(yc));
doubleout(convPS(xrad));
- if (xrad != yrad && VDPI == DPI)
- doubleout(convPS(yrad));
+ if (xrad != yrad || VDPI != DPI)
+ doubleout(convVPS(yrad));
doubleout(convDeg(startAngle));
doubleout(convDeg(endAngle));
if (xrad == yrad && VDPI == DPI) /* for arcs and circles */
- cmdout("arc");
+ cmdout("arc");
else
- cmdout("ellipse");
+ cmdout("ellipse");
cmdout(FILL);
shading = NONE;
@@ -232,12 +234,12 @@ arc(char *cp, int invis)
doubleout(hconvPS(xc));
doubleout(vconvPS(yc));
doubleout(convPS(xrad));
- if (xrad != yrad)
- doubleout(convPS(yrad));
+ if (xrad != yrad || VDPI != DPI)
+ doubleout(convVPS(yrad));
doubleout(degStAng);
doubleout(degEnAng);
- if (xrad == yrad) /* for arcs and circles */
+ if (xrad == yrad && VDPI == DPI) /* for arcs and circles */
cmdout("arc");
else
cmdout("ellipse");
@@ -461,7 +463,7 @@ void
flushSpline(char *cp)
{ /* as exact as psdit!!! */
register long i;
- register double dxi, dyi, dxi1, dyi1;
+ register double px, py, dx, dy;
if (*cp) {
double inchesPerDash;
@@ -498,23 +500,22 @@ flushSpline(char *cp)
doubleout(hconvPS(xx[1]));
doubleout(vconvPS(yy[1]));
cmdout(MOVETO);
- doubleout(convPS((xx[2]-xx[1])/2));
- doubleout(convPS((yy[2]-yy[1])/2));
+ px = convPS(xx[1]);
+ py = convVPS(yy[1]);
+ doubleout(dx = convPS((xx[2]+xx[1])/2) - px);
+ doubleout(dy = convVPS((yy[2]+yy[1])/2) - py);
cmdout(RLINETO);
for (i=2; i < pathLen; i++)
{
- dxi = convPS(xx[i] - xx[i-1]);
- dyi = convVPS(yy[i] - yy[i-1]);
- dxi1 = convPS(xx[i+1] - xx[i]);
- dyi1 = convVPS(yy[i+1] - yy[i]);
-
- doubleout(dxi/3);
- doubleout(dyi/3);
- doubleout((3*dxi+dxi1)/6);
- doubleout((3*dyi+dyi1)/6);
- doubleout((dxi+dxi1)/2);
- doubleout((dyi+dyi1)/2);
+ px += dx;
+ py += dy;
+ doubleout(convPS((xx[i-1]+5*xx[i])/6) - px);
+ doubleout(convVPS((yy[i-1]+5*yy[i])/6) - py);
+ doubleout(convPS((5*xx[i]+xx[i+1])/6) - px);
+ doubleout(convVPS((5*yy[i]+yy[i+1])/6) - py);
+ doubleout(dx = convPS((xx[i]+xx[i+1])/2) - px);
+ doubleout(dy = convVPS((yy[i]+yy[i+1])/2) - py);
cmdout(RCURVETO);
}
@@ -653,12 +654,11 @@ doShading(void)
*/
static double
zPixRound(register double x, /* in DVI units */
- register double convDPI /* dots per inch */
- ) /* return rounded number of pixels */
+ register double convDPI /* dots per inch */
+ ) /* return rounded number of pixels */
{
return ((x * mag * (double)convDPI /
(1000.0 * tpicRESOLUTION)));
}
#endif /* TPIC */
-