[
https://issues.apache.org/jira/browse/PDFBOX-1970?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13925380#comment-13925380
]
John Hewson commented on PDFBOX-1970:
-------------------------------------
{quote}
I don't have an overview over the complete project, so I can't tell why the
AffineTransform is like it is in 1.8
{quote}
In 1.8 the drawing of the page is done using the standard AWT y-axis where y=0
is at the top of the page:
{code}
x
----->
y |
|
v
{code}
This code in PageDrawer is used to flip all y-axis coordinates before drawing:
{code}
/**
* Fix the y coordinate.
*
* @param y The y coordinate.
* @return The updated y coordinate.
*/
public double fixY( double y )
{
return pageSize.getHeight() - y;
}
{code}
But in 2.0 this changed so that drawing is done using the standard PDF y-axis
where y=0 is at the bottom of the page:
{code}
^
y |
|
----->
x
{code}
and the drawing is flipped by Graphics2D using the {{graphics.scale(1,-1)}},
which is a more typical way to solve the problem.
> 1.8 shadings are sometimes flipped
> ----------------------------------
>
> Key: PDFBOX-1970
> URL: https://issues.apache.org/jira/browse/PDFBOX-1970
> Project: PDFBox
> Issue Type: Bug
> Affects Versions: 1.8.4
> Reporter: Tilman Hausherr
> Labels: shading, shadingpattern
> Fix For: 1.8.5
>
> Attachments: _asy-gouraud.pdf-1.png, asy-gouraud.pdf
>
>
> Some of my shading test images are sometimes flipped when done with the 1.8
> branch, not with the trunk. I have observed this with shadingtype 1, 4 and 5.
> The shadingContext is created with an AffineTransform (the CTM is identical
> and its just a translation) of
> [1.0, 0.0, 399.0]
> [0.0, 1.0, 49.0]
> for the 1.8 branch (bad)
> and with
> [1.0, 0.0, 399.0]
> [0.0, -1.0, 149.0]
> for the trunk (good).
--
This message was sent by Atlassian JIRA
(v6.2#6252)