diff options
Diffstat (limited to 'src/java/org/apache/fop/area')
-rw-r--r-- | src/java/org/apache/fop/area/Page.java | 5 | ||||
-rw-r--r-- | src/java/org/apache/fop/area/RegionReference.java | 14 |
2 files changed, 18 insertions, 1 deletions
diff --git a/src/java/org/apache/fop/area/Page.java b/src/java/org/apache/fop/area/Page.java index 64a6db576..94a394014 100644 --- a/src/java/org/apache/fop/area/Page.java +++ b/src/java/org/apache/fop/area/Page.java @@ -126,6 +126,10 @@ public class Page extends AreaTreeObject implements Serializable, Cloneable { } else { rr = new RegionReference(r, rvp); } + // set borders and padding traits + // (a little extensions wrt what prescribed by the specs at 6.4.14) + TraitSetter.addBorders(rr, r.getCommonBorderPaddingBackground(), false, false, false, false, null); + TraitSetter.addPadding(rr, r.getCommonBorderPaddingBackground(), false, false, false, false, null); setRegionReferencePosition(rr, r, rvp.getViewArea()); rvp.setRegionReference(rr); setRegionViewport(r.getNameId(), rvp); @@ -289,3 +293,4 @@ public class Page extends AreaTreeObject implements Serializable, Cloneable { } + diff --git a/src/java/org/apache/fop/area/RegionReference.java b/src/java/org/apache/fop/area/RegionReference.java index c41de7c7a..467aadd85 100644 --- a/src/java/org/apache/fop/area/RegionReference.java +++ b/src/java/org/apache/fop/area/RegionReference.java @@ -73,6 +73,18 @@ public class RegionReference extends Area implements Cloneable { blocks.add(child); } + /** {@inheritDoc} */ + public int getBPD() { + // subtract bpd of borders and padding before / after + return super.getBPD() - getBorderAndPaddingWidthBefore() - getBorderAndPaddingWidthAfter(); + } + + /** {@inheritDoc} */ + public int getIPD() { + // subtract ipd of borders and padding start / end + return super.getIPD() - getBorderAndPaddingWidthStart() - getBorderAndPaddingWidthEnd(); + } + /** * Set the Coordinate Transformation Matrix which transforms content * coordinates in this region reference area which are specified in @@ -133,7 +145,7 @@ public class RegionReference extends Area implements Cloneable { public void addBlock(Block block) { addChildArea(block); } - + /** * Clone this region. * This is used when cloning the page by the page master. |