[gs-cvs] rev 7706 - in trunk/gs: doc src

leonardo at ghostscript.com leonardo at ghostscript.com
Fri Feb 16 07:27:50 PST 2007


Author: leonardo
Date: 2007-02-16 07:27:49 -0800 (Fri, 16 Feb 2007)
New Revision: 7706

Modified:
   trunk/gs/doc/pscet_status.txt
   trunk/gs/src/gxstroke.c
Log:
Fix (stroking) : An imprecise miter limit check.

DETAILS :

The old code uses cap points for computing the miter tangent.
However cap points do not precisely represent the stroke direction
due a rounding to 'fixed' after the stroke width proportion.
The new code uses the precise stroke direction.
The new field partial_line::vector is used to
pass the direction for zero length dashes.
Thanks for Timoty Osborn for detecting this problem.

EXPECTED DIFFERENCES :
Normal 72dpi :
205-13.ps

CET 300dpi ;
09-37-8
09-45-1 progression
09-45-2 progression
11-28-3
11-28-3


Modified: trunk/gs/doc/pscet_status.txt
===================================================================
--- trunk/gs/doc/pscet_status.txt	2007-02-16 13:25:42 UTC (rev 7705)
+++ trunk/gs/doc/pscet_status.txt	2007-02-16 15:27:49 UTC (rev 7706)
@@ -892,12 +892,9 @@
 
 09-44-7  OK	
 
-09-45-1  DIFF	GS has missing 'miter' extension on leftmost second row.
-		(Tek and CPSI render 7 'V' with miter join, GS only 6).
-		assign: Ray
+09-45-1  OK
 
-09-45-2  DIFF	Similar to 09-45-1. GS missing miter extensions top row,
-		rightmost and bottom row, second from left.  assign: Ray
+09-45-2  OK
 
 09-45-3  OK	
 

Modified: trunk/gs/src/gxstroke.c
===================================================================
--- trunk/gs/src/gxstroke.c	2007-02-16 13:25:42 UTC (rev 7705)
+++ trunk/gs/src/gxstroke.c	2007-02-16 15:27:49 UTC (rev 7706)
@@ -197,6 +197,7 @@
     endpoint o;			/* starting coordinate */
     endpoint e;			/* ending coordinate */
     gs_fixed_point width;	/* one-half line width, see above */
+    gs_fixed_point vector;	/* The line segment direction */
     bool thin;			/* true if minimum-width line */
 } partial_line;
 typedef partial_line *pl_ptr;
@@ -658,6 +659,8 @@
 		pl.e.p.x = sx;
 		pl.e.p.y = sy;
 	    }
+	    pl.vector.x = udx;
+	    pl.vector.y = udy;
 	    if (always_thin) {
 		pl.e.cdelta.x = pl.e.cdelta.y = 0;
 		pl.width.x = pl.width.y = 0;
@@ -1490,8 +1493,8 @@
 	 * computations in user space.
 	 */
 	float check = pgs_lp->miter_check;
-	double u1 = plp->e.cdelta.y, v1 = plp->e.cdelta.x;
-	double u2 = nplp->o.cdelta.y, v2 = nplp->o.cdelta.x;
+	double u1 = plp->vector.y, v1 = plp->vector.x;
+	double u2 = -nplp->vector.y, v2 = -nplp->vector.x;
 	double num, denom;
 	int code;
 
@@ -1562,6 +1565,8 @@
 	 *              +       -               false
 	 *              -       -               T >= check
 	 */
+	if (num == 0 && denom == 0)
+	    return_error(gs_error_unregistered); /* Must not happen. */
 	if (denom < 0)
 	    num = -num, denom = -denom;
 	/* Now denom >= 0, so sign(num) = sign(T). */



More information about the gs-cvs mailing list