xmlgraphics-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 53177] [PATCH] Fix for XGC when rendering PostScript using SVG being drawn upside down when using a custom affine transform.
Date Wed, 02 May 2012 14:06:51 GMT

rmeyer@hotmail.co.uk changed:

           What    |Removed                     |Added
            Summary|[PATCH] Fix for SVG where   |[PATCH] Fix for XGC when
                   |in PostScript it was being  |rendering PostScript using
                   |upside down when using a    |SVG being drawn upside down
                   |custom affine transform.    |when using a custom affine
                   |                            |transform.

--- Comment #2 from rmeyer@hotmail.co.uk ---
PostScript documents are by default drawn from the bottom up, because of this
FOP changes the Y axis for each generated PS file so everything on the page is
inverted and can be displayed in the same way as other document types such as

If however, an SVG drawing co-ordinates were specified from the top down, a
custom transform would need to be applied to counter FOP's automatic switch.
The problem was that a checkTransform method prevented any new transform
matching the current page transform from being applied. This original intention
of this checkTransform method was to reduce the number of times the same
transform is applied to the postscript file thus reducing its size. This is
because if a transform is applied to an SVG drawing, for each shape being drawn
the transform is applied at the shape level instead of at a drawing or
subsequent svg parent level.

Where the checkTransform method fails is that it only checks for one outcome
which is the initial page transform which in this case causes the problem. If
you change the transform to invert the drawing by one pixel less e.g. [ ... 791
] instead of [ ... 792 ] the transform would be applied on each shape and it
would appear correctly (albeit a little off centre). This is because the
transform is applied for the shape and then the graphics state is reverted
meaning the current page state is never changed and the only transform it would
ever ignore would be one matching the original FOP inversion transform.

As such I have removed this method and added a test unit case to prove it is
now concatenating the affine transform correctly. The checkTransform method was
a good idea, but due to the way Batik, Fop and XGC passing transforms onto
child objects this is not currently possible to implement a fix and subsqeuent
reduction in PS file sizes.

You are receiving this mail because:
You are the assignee for the bug.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message