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

alexcher at ghostscript.com alexcher at ghostscript.com
Wed Oct 25 05:10:10 PDT 2006


Author: alexcher
Date: 2006-10-25 05:10:09 -0700 (Wed, 25 Oct 2006)
New Revision: 7121

Modified:
   trunk/gs/src/zshade.c
Log:
Normalize bounding box retrieved from PostScript BBox parameter in the
shading dictionary because Adobe interpreters accept denormalized box.
Bug 688937, customer 200.

DIFFERENCES:
None


Modified: trunk/gs/src/zshade.c
===================================================================
--- trunk/gs/src/zshade.c	2006-10-24 15:13:03 UTC (rev 7120)
+++ trunk/gs/src/zshade.c	2006-10-25 12:10:09 UTC (rev 7121)
@@ -195,10 +195,21 @@
 	params.have_BBox = false;
     else if ((code = dict_floats_param(imemory, op, "BBox", 
 				       4, box, NULL)) == 4) {
-	params.BBox.p.x = box[0];
-	params.BBox.p.y = box[1];
-	params.BBox.q.x = box[2];
-	params.BBox.q.y = box[3];
+	/* Adobe Interpreters accept denormalised BBox - bug 688937 */
+        if (box[0] <= box[2]) {
+            params.BBox.p.x = box[0];
+ 	    params.BBox.q.x = box[2];
+        } else {
+            params.BBox.p.x = box[2];
+ 	    params.BBox.q.x = box[0];
+        }
+	if (box[1] <= box[3]) {
+            params.BBox.p.y = box[1];
+	    params.BBox.q.y = box[3];
+        } else {
+            params.BBox.p.y = box[3];
+	    params.BBox.q.y = box[1];
+        }
 	params.have_BBox = true;
     } else
 	goto fail;



More information about the gs-cvs mailing list