[gs-cvs] rev 7199 - trunk/gs/src

leonardo at ghostscript.com leonardo at ghostscript.com
Mon Nov 13 13:12:10 PST 2006


Author: leonardo
Date: 2006-11-13 13:12:10 -0800 (Mon, 13 Nov 2006)
New Revision: 7199

Modified:
   trunk/gs/src/gxshade1.c
Log:
Fix (shadings) : Don't fill ShadingType 1 when the region is outside the function domain.

DETAILS :

Debugged with 09-47G-1.PS SpecialTestF02Test01 .
The old code returned rangecheck when it must not paint anything except Background.
It happened due to an attempt to check the function monotonity outside its domain.

EXPECTED DIFFERENCES :

None.


Modified: trunk/gs/src/gxshade1.c
===================================================================
--- trunk/gs/src/gxshade1.c	2006-11-13 19:05:22 UTC (rev 7198)
+++ trunk/gs/src/gxshade1.c	2006-11-13 21:12:10 UTC (rev 7199)
@@ -135,6 +135,10 @@
 	y[0] = max(pbox.p.y, psh->params.Domain[2]);
 	y[1] = min(pbox.q.y, psh->params.Domain[3]);
     }
+    if (x[0] > x[1] || y[0] > y[1]) {
+	/* The region is outside the shading area. */
+	return 0;
+    }
     for (xi = 0; xi < 2; ++xi)
 	for (yi = 0; yi < 2; ++yi) {
 	    float v[2];



More information about the gs-cvs mailing list