aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache
diff options
context:
space:
mode:
authorKeiron Liddle <keiron@apache.org>2002-09-09 10:35:09 +0000
committerKeiron Liddle <keiron@apache.org>2002-09-09 10:35:09 +0000
commitdd8891583eb347173ca359067098aafd2b7115f0 (patch)
tree57c4534c4545da13bccc1508b64b59da3452fa37 /src/org/apache
parent065009c088c0d77444db4669aadbf8e57c377375 (diff)
downloadxmlgraphics-fop-dd8891583eb347173ca359067098aafd2b7115f0.tar.gz
xmlgraphics-fop-dd8891583eb347173ca359067098aafd2b7115f0.zip
fixes some vertical alignment
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@195160 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache')
-rw-r--r--src/org/apache/fop/fo/flow/PageNumber.java4
-rw-r--r--src/org/apache/fop/fo/flow/PageNumberCitation.java4
-rw-r--r--src/org/apache/fop/layoutmgr/ContentLayoutManager.java33
3 files changed, 41 insertions, 0 deletions
diff --git a/src/org/apache/fop/fo/flow/PageNumber.java b/src/org/apache/fop/fo/flow/PageNumber.java
index 449413488..58654a866 100644
--- a/src/org/apache/fop/fo/flow/PageNumber.java
+++ b/src/org/apache/fop/fo/flow/PageNumber.java
@@ -72,6 +72,10 @@ public class PageNumber extends FObj {
return inline;
}
+
+ protected void offsetArea(LayoutContext context) {
+ curArea.setOffset(context.getBaseline());
+ }
}
);
}
diff --git a/src/org/apache/fop/fo/flow/PageNumberCitation.java b/src/org/apache/fop/fo/flow/PageNumberCitation.java
index 3093dfc37..b6ac87fad 100644
--- a/src/org/apache/fop/fo/flow/PageNumberCitation.java
+++ b/src/org/apache/fop/fo/flow/PageNumberCitation.java
@@ -75,6 +75,10 @@ public class PageNumberCitation extends FObj {
(Resolveable) inline);
}
}
+
+ protected void offsetArea(LayoutContext context) {
+ curArea.setOffset(context.getBaseline());
+ }
}
);
}
diff --git a/src/org/apache/fop/layoutmgr/ContentLayoutManager.java b/src/org/apache/fop/layoutmgr/ContentLayoutManager.java
index 27204bedc..bf7c364c7 100644
--- a/src/org/apache/fop/layoutmgr/ContentLayoutManager.java
+++ b/src/org/apache/fop/layoutmgr/ContentLayoutManager.java
@@ -43,14 +43,47 @@ public class ContentLayoutManager implements LayoutManager {
childLC.setStackLimit(new MinOptMax(ipd));
childLC.setRefIPD(ipd);
+ int lineHeight = 14000;
+ int lead = 12000;
+ int follow = 2000;
+
+ int halfLeading = (lineHeight - lead - follow) / 2;
+ // height before baseline
+ int lineLead = lead + halfLeading;
+ // maximum size of top and bottom alignment
+ int maxtb = follow + halfLeading;
+ // max size of middle alignment below baseline
+ int middlefollow = maxtb;
+
while (!curLM.isFinished()) {
if ((bp = curLM.getNextBreakPoss(childLC)) != null) {
stack.add(bp.getStackingSize());
childBreaks.add(bp);
+
+ if(bp.getLead() > lineLead) {
+ lineLead = bp.getLead();
+ }
+ if(bp.getTotal() > maxtb) {
+ maxtb = bp.getTotal();
+ }
+ if(bp.getMiddle() > middlefollow) {
+ middlefollow = bp.getMiddle();
+ }
}
}
+ if(maxtb - lineLead > middlefollow) {
+ middlefollow = maxtb - lineLead;
+ }
+
+ //if(holder instanceof InlineParent) {
+ // ((InlineParent)holder).setHeight(lineHeight);
+ //}
+
LayoutContext lc = new LayoutContext(0);
+ lc.setBaseline(lineLead);
+ lc.setLineHeight(lineHeight);
+
lc.setFlags(LayoutContext.RESOLVE_LEADING_SPACE, true);
lc.setLeadingSpace(new SpaceSpecifier(false));
lc.setTrailingSpace(new SpaceSpecifier(false));