[gs-commits] rev 11662 - trunk/gs/base
ken at ghostscript.com
ken at ghostscript.com
Fri Aug 27 13:54:15 UTC 2010
Author: ken
Date: 2010-08-27 13:54:14 +0000 (Fri, 27 Aug 2010)
New Revision: 11662
Modified:
trunk/gs/base/gdevpdfv.c
Log:
Fix (pdfwrite) : faulty matrix transformations for Pattern dictionaries
Bug #690398 "Geometric issue with pattern"
The problem is the definition of the default co-ordinate space. When a Pattern is at the
page level or drawn inside a form, we need to remove our 0.1 scaling in order to return
to the 'default co-ordinate space'. However, when painted on a form nested inside a
form, the default co-ordinate space is the parent form, so we don't need to undo
the scaling.
This is the same problem addressed for shading dictionaries in revision 11347.
Expected Differences
Bug6901014_CityMap-evince.pdf
Bug6901014_CityMap-evince.simplified.pdf
Bug689422.pdf
All show progressions with this change.
Modified: trunk/gs/base/gdevpdfv.c
===================================================================
--- trunk/gs/base/gdevpdfv.c 2010-08-27 12:10:54 UTC (rev 11661)
+++ trunk/gs/base/gdevpdfv.c 2010-08-27 13:54:14 UTC (rev 11662)
@@ -219,12 +219,21 @@
positive bitmap pixel indices. Compensate it now. */
smat.tx += pinst->step_matrix.tx;
smat.ty += pinst->step_matrix.ty;
+ /*
+ * In PDF, the Matrix is the transformation from the pattern space to
+ * the *default* user coordinate space, not the current space.
+ * NB. For a form the default space is the parent. This means that when a
+ * form is nested inside a form, the default space is the space of the
+ * first form, and therefore we do *not* remove the resolution scaling.
+ */
+ if (pdev->FormDepth <= 1) {
smat.xx /= scale_x;
smat.xy /= scale_x;
smat.yx /= scale_y;
smat.yy /= scale_y;
smat.tx /= scale_x;
smat.ty /= scale_y;
+ }
if (any_abs(smat.tx) < 0.0001) /* Noise. */
smat.tx = 0;
if (any_abs(smat.ty) < 0.0001)
More information about the gs-commits
mailing list