From 72d4de19de6175a92213e3c05e11b71dd1ed2714 Mon Sep 17 00:00:00 2001 From: Luis Bernardo Date: Sun, 13 Oct 2013 23:31:46 +0000 Subject: [PATCH] FOP-1872: External document is clipped when rotated; patch submitted by Thanasis Giannimaras. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1531769 13f79535-47bb-0310-9956-ffa450edef68 --- .../fop/layoutmgr/ExternalDocumentLayoutManager.java | 10 ++++++++-- .../standard-testcases/fox_external-document_2.xml | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/java/org/apache/fop/layoutmgr/ExternalDocumentLayoutManager.java b/src/java/org/apache/fop/layoutmgr/ExternalDocumentLayoutManager.java index 7cbe33f26..aae5a6b30 100644 --- a/src/java/org/apache/fop/layoutmgr/ExternalDocumentLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/ExternalDocumentLayoutManager.java @@ -242,8 +242,14 @@ public class ExternalDocumentLayoutManager extends AbstractPageSequenceLayoutMan pv.setPage(pageArea); RegionViewport rv = new RegionViewport(referenceRect); - rv.setIPD(referenceRect.width); - rv.setBPD(referenceRect.height); + + if (pageSeq.getReferenceOrientation() % 180 == 0) { + rv.setIPD(referenceRect.width); + rv.setBPD(referenceRect.height); + } else { + rv.setIPD(referenceRect.height); + rv.setBPD(referenceRect.width); + } rv.setClip(true); BodyRegion body = new BodyRegion(Constants.FO_REGION_BODY, diff --git a/test/layoutengine/standard-testcases/fox_external-document_2.xml b/test/layoutengine/standard-testcases/fox_external-document_2.xml index b2f397580..29485ed72 100644 --- a/test/layoutengine/standard-testcases/fox_external-document_2.xml +++ b/test/layoutengine/standard-testcases/fox_external-document_2.xml @@ -71,8 +71,8 @@ - - + + -- 2.39.5