https://issues.apache.org/bugzilla/show_bug.cgi?id=46826





--- Comment #9 from Andreas L. Delmelle <[email protected]>  2009-03-22 
02:05:39 PST ---

The method fop.fo.pagination.Region.getViewportRectangle() returns a rectangle
that takes into account the reference-orientation and writing-mode specified on
the passed simple-page-master. 
Note: Not sure why the page-master is needed as an argument, since every Region
has access to its parent (which can only be a simple-page-master). Some
refactoring of the related classes seems to be in order (see the various
implementations in org.apache.fop.fo.pagination).
The code blocks for initializing the pageWidthContext and pageHeightContext
seem to belong in protected final methods in SimplePageMaster, rather than
being repeated in every Region.

Anyway, the returned rectangle has a width that is correctly constrained by the
page-height if the page-master is rotated. So far, no real problem.

The method getViewportRectangle() is used in fop.area.Page. The returned
rectangle is transformed by the pageCTM, and stored in RegionViewport as the
viewArea. What seems slightly suspicious to me is that the position and
dimensions of the region-reference-area are based on that viewArea, without
taking into account that it may already be the result of a transform. (i.e. the
viewArea's width in absolute terms, will be taken as IPD for the region

Currently, for a rotated simple-page-master, the region-reference-area's IPD
will be conveniently set to the height of the viewArea, but this seems kind of
a fluke... :-/ 
Since the region inherits the reference-orientation, the CTM that is attached
to the RegionReference will also reflect the 'absolute' rotation of the page.
If we treat it as a non-inheritable, the value on the region becomes 0, which
should mean 'the same orientation as the page-reference-area',  but the effect
we get is that only the region-viewports appear rotated... The content appears
rotated back to the original page-viewport orientation. 

If we correct this --as happens in the patch-- by passing the
region-reference's 'absolute' rotation with regard to the page-viewport to
getCTMAndRelDims(), then we get get a correct CTM and dimensions for the
region-reference, but for the clipping rectangle the two CTMs (page and region)
are combined to transform the viewArea. That one's already transformed, hence
why we get the result in the attached PDF.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Reply via email to