aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlen Mazza <gmazza@apache.org>2003-11-02 16:20:16 +0000
committerGlen Mazza <gmazza@apache.org>2003-11-02 16:20:16 +0000
commitcfda23fd7b48deb9af1024ac8242b285cc78e311 (patch)
tree8deb56cf10ee77492ad853b4175c7ffa98bb6c6e
parent2a39d3fdaab42b43563cc622094269006c669272 (diff)
downloadxmlgraphics-fop-cfda23fd7b48deb9af1024ac8242b285cc78e311.tar.gz
xmlgraphics-fop-cfda23fd7b48deb9af1024ac8242b285cc78e311.zip
Clearer method names given for finding border and padding for regions.
See: http://marc.theaimsgroup.com/?l=fop-dev&m=106777246222766&w=2 and http://www.w3.org/TR/2001/REC-xsl-20011015/slice4.html#area-stackblock git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196979 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/java/org/apache/fop/area/RegionViewport.java28
-rw-r--r--src/java/org/apache/fop/layoutmgr/PageLayoutManager.java5
-rw-r--r--src/java/org/apache/fop/render/pdf/PDFRenderer.java11
3 files changed, 19 insertions, 25 deletions
diff --git a/src/java/org/apache/fop/area/RegionViewport.java b/src/java/org/apache/fop/area/RegionViewport.java
index 53ffa28e4..1c83901e5 100644
--- a/src/java/org/apache/fop/area/RegionViewport.java
+++ b/src/java/org/apache/fop/area/RegionViewport.java
@@ -112,12 +112,11 @@ public class RegionViewport extends Area implements Cloneable {
}
/**
- * Return the margin-before offset for printing text
- * (sum of region border and padding)
+ * Return the sum of region border- and padding-before
*
- * @return margin-before offset, in millipoints
+ * @return width in millipoints
*/
- public int getMarginBeforeWidth() {
+ public int getBorderAndPaddingWidthBefore() {
int margin = 0;
BorderProps bps = (BorderProps) getTrait(Trait.BORDER_BEFORE);
if (bps != null) {
@@ -133,12 +132,11 @@ public class RegionViewport extends Area implements Cloneable {
}
/**
- * Return the margin-after offset for printing text
- * (sum of region border and padding)
+ * Return the sum of region border- and padding-after
*
- * @return margin-after offset, in millipoints
+ * @return width in millipoints
*/
- public int getMarginAfterWidth() {
+ public int getBorderAndPaddingWidthAfter() {
int margin = 0;
BorderProps bps = (BorderProps) getTrait(Trait.BORDER_AFTER);
@@ -155,12 +153,11 @@ public class RegionViewport extends Area implements Cloneable {
}
/**
- * Return the margin-start offset for printing text
- * (sum of region border and padding)
+ * Return the sum of region border- and padding-start
*
- * @return margin-start offset, in millipoints
+ * @return width in millipoints
*/
- public int getMarginStartWidth() {
+ public int getBorderAndPaddingWidthStart() {
int margin = 0;
BorderProps bps = (BorderProps) getTrait(Trait.BORDER_START);
if (bps != null) {
@@ -176,12 +173,11 @@ public class RegionViewport extends Area implements Cloneable {
}
/**
- * Return the margin-end offset for printing text
- * (sum of region border and padding)
+ * Return the sum of region border- and padding-end
*
- * @return margin-end offset, in millipoints
+ * @return width in millipoints
*/
- public int getMarginEndWidth() {
+ public int getBorderAndPaddingWidthEnd() {
int margin = 0;
BorderProps bps = (BorderProps) getTrait(Trait.BORDER_END);
if (bps != null) {
diff --git a/src/java/org/apache/fop/layoutmgr/PageLayoutManager.java b/src/java/org/apache/fop/layoutmgr/PageLayoutManager.java
index acc842778..ec4938f10 100644
--- a/src/java/org/apache/fop/layoutmgr/PageLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/PageLayoutManager.java
@@ -475,7 +475,8 @@ public class PageLayoutManager extends AbstractLayoutManager implements Runnable
Region.BODY_CODE);
curBody = (BodyRegion) rv.getRegion();
flowBPD = (int) rv.getViewArea().getHeight() -
- rv.getMarginBeforeWidth() - rv.getMarginAfterWidth();
+ rv.getBorderAndPaddingWidthBefore() - rv.getBorderAndPaddingWidthAfter();
+
return curPage;
}
@@ -714,7 +715,7 @@ public class PageLayoutManager extends AbstractLayoutManager implements Runnable
RegionViewport rv = curPage.getPage().getRegionViewport(Region.BODY_CODE);
int ipdWidth = (int) rv.getViewArea().getWidth() -
- rv.getMarginStartWidth() - rv.getMarginEndWidth();
+ rv.getBorderAndPaddingWidthStart() - rv.getBorderAndPaddingWidthEnd();
curSpan.setIPD(ipdWidth);
//curSpan.setPosition(BPD, newpos);
diff --git a/src/java/org/apache/fop/render/pdf/PDFRenderer.java b/src/java/org/apache/fop/render/pdf/PDFRenderer.java
index 806ea0f95..5ee316c0f 100644
--- a/src/java/org/apache/fop/render/pdf/PDFRenderer.java
+++ b/src/java/org/apache/fop/render/pdf/PDFRenderer.java
@@ -530,15 +530,12 @@ public class PDFRenderer extends PrintRenderer {
Rectangle2D viewArea = region.getViewArea();
float width = (float)(viewArea.getWidth() / 1000f);
float height = (float)(viewArea.getHeight() / 1000f);
- /*
- Trait.Background back;
- back = (Trait.Background)region.getTrait(Trait.BACKGROUND);
- */
- if (region.getRegion().getRegionClass() == org.apache.fop.fo.pagination.Region.BODY_CODE)
+ if (region.getRegion().getRegionClass()
+ == org.apache.fop.fo.pagination.Region.BODY_CODE)
{
- BPMarginOffset = region.getMarginBeforeWidth();
- IPMarginOffset = region.getMarginStartWidth();
+ BPMarginOffset = region.getBorderAndPaddingWidthBefore();
+ IPMarginOffset = region.getBorderAndPaddingWidthStart();
}
drawBackAndBorders(region, startx, starty, width, height);