You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by ke...@apache.org on 2002/09/09 12:35:09 UTC
cvs commit: xml-fop/src/org/apache/fop/layoutmgr ContentLayoutManager.java
keiron 2002/09/09 03:35:09
Modified: src/org/apache/fop/fo/flow PageNumber.java
PageNumberCitation.java
src/org/apache/fop/layoutmgr ContentLayoutManager.java
Log:
fixes some vertical alignment
Revision Changes Path
1.28 +5 -1 xml-fop/src/org/apache/fop/fo/flow/PageNumber.java
Index: PageNumber.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/PageNumber.java,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- PageNumber.java 4 Sep 2002 11:43:41 -0000 1.27
+++ PageNumber.java 9 Sep 2002 10:35:09 -0000 1.28
@@ -72,6 +72,10 @@
return inline;
}
+
+ protected void offsetArea(LayoutContext context) {
+ curArea.setOffset(context.getBaseline());
+ }
}
);
}
1.27 +5 -1 xml-fop/src/org/apache/fop/fo/flow/PageNumberCitation.java
Index: PageNumberCitation.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/PageNumberCitation.java,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- PageNumberCitation.java 7 Sep 2002 08:58:06 -0000 1.26
+++ PageNumberCitation.java 9 Sep 2002 10:35:09 -0000 1.27
@@ -75,6 +75,10 @@
(Resolveable) inline);
}
}
+
+ protected void offsetArea(LayoutContext context) {
+ curArea.setOffset(context.getBaseline());
+ }
}
);
}
1.6 +34 -1 xml-fop/src/org/apache/fop/layoutmgr/ContentLayoutManager.java
Index: ContentLayoutManager.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/layoutmgr/ContentLayoutManager.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ContentLayoutManager.java 7 Sep 2002 08:58:06 -0000 1.5
+++ ContentLayoutManager.java 9 Sep 2002 10:35:09 -0000 1.6
@@ -43,14 +43,47 @@
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));
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-cvs-help@xml.apache.org