diff options
Diffstat (limited to 'src/java/org/apache/fop/area')
-rw-r--r-- | src/java/org/apache/fop/area/BodyRegion.java | 9 | ||||
-rw-r--r-- | src/java/org/apache/fop/area/MainReference.java | 6 |
2 files changed, 10 insertions, 5 deletions
diff --git a/src/java/org/apache/fop/area/BodyRegion.java b/src/java/org/apache/fop/area/BodyRegion.java index 89bb206f2..df7e914b7 100644 --- a/src/java/org/apache/fop/area/BodyRegion.java +++ b/src/java/org/apache/fop/area/BodyRegion.java @@ -81,6 +81,15 @@ public class BodyRegion extends RegionReference { return this.columnGap; } + int getContentIPD() { + RegionViewport rv = getRegionViewport(); + return getIPD() - rv.getBorderAndPaddingWidthStart() - rv.getBorderAndPaddingWidthEnd(); + } + + public int getColumnIPD() { + return (getContentIPD() - (columnCount - 1) * columnGap) / columnCount; + } + /** * Get the main reference area. * diff --git a/src/java/org/apache/fop/area/MainReference.java b/src/java/org/apache/fop/area/MainReference.java index efc16515d..9778db87f 100644 --- a/src/java/org/apache/fop/area/MainReference.java +++ b/src/java/org/apache/fop/area/MainReference.java @@ -59,12 +59,8 @@ public class MainReference extends Area { //Remove the current one if it is empty spanAreas.remove(spanAreas.size() - 1); } - RegionViewport rv = parent.getRegionViewport(); - int ipdWidth = parent.getIPD() - - rv.getBorderAndPaddingWidthStart() - rv.getBorderAndPaddingWidthEnd(); - Span newSpan = new Span(((spanAll) ? 1 : getColumnCount()), - getColumnGap(), ipdWidth); + getColumnGap(), parent.getContentIPD()); spanAreas.add(newSpan); return getCurrentSpan(); } |