[gs-cvs] rev 7904 - trunk/gs/src
tim at ghostscript.com
tim at ghostscript.com
Mon May 7 10:42:00 PDT 2007
Author: tim
Date: 2007-05-07 10:42:00 -0700 (Mon, 07 May 2007)
New Revision: 7904
Modified:
trunk/gs/src/gdevp14.c
Log:
Fixing a bounding box pixel rounding issue in pdf14_begin_transparency_group.
DETAILS:
The transparency group bounding box calculation was using a different rounding
method than is being used for images. This caused the problem file in bug
report #688543 to display unwanted gray vertical lines to the left and right of
a transparency group. This fix is to use the same "Center-of-pixel Filling Rule"
that is applied to images to avoid this type of problem.
EXPECTED DIFFERENCES:
Because of this bounding box rounding change, some jobs in the regression suite
(specifically a12.pdf, Bug688631.pdf and SoftMaskGroup.pdf) will have some
minor differences.
Modified: trunk/gs/src/gdevp14.c
===================================================================
--- trunk/gs/src/gdevp14.c 2007-05-07 10:33:00 UTC (rev 7903)
+++ trunk/gs/src/gdevp14.c 2007-05-07 17:42:00 UTC (rev 7904)
@@ -2141,14 +2141,24 @@
gs_rect dev_bbox;
gs_int_rect rect;
int code;
+ gs_fixed_point p0;
code = gs_bbox_transform(pbbox, &ctm_only(pis), &dev_bbox);
if (code < 0)
return code;
- rect.p.x = (int)floor(dev_bbox.p.x);
- rect.p.y = (int)floor(dev_bbox.p.y);
- rect.q.x = (int)ceil(dev_bbox.q.x);
- rect.q.y = (int)ceil(dev_bbox.q.y);
+
+ p0.x = float2fixed( dev_bbox.p.x );
+ p0.y = float2fixed( dev_bbox.p.y );
+
+ rect.p.x = fixed2int_pixround( p0.x );
+ rect.p.y = fixed2int_pixround( p0.y );
+
+ p0.x = float2fixed( dev_bbox.q.x );
+ p0.y = float2fixed( dev_bbox.q.y );
+
+ rect.q.x = fixed2int_pixround( p0.x );
+ rect.q.y = fixed2int_pixround( p0.y );
+
rect_intersect(rect, pdev->ctx->rect);
/* Make sure the rectangle is not anomalous (q < p) -- see gsrect.h */
if (rect.q.x < rect.p.x)
More information about the gs-cvs
mailing list