diff options
author | Glen Mazza <gmazza@apache.org> | 2003-11-11 13:50:00 +0000 |
---|---|---|
committer | Glen Mazza <gmazza@apache.org> | 2003-11-11 13:50:00 +0000 |
commit | 2f633bd8c527829b187a9dbb2927373da600d247 (patch) | |
tree | 3ab9b502bc34ecfaf92344ed570ab1d857e547b0 /src/java/org/apache/fop | |
parent | ed0e5a7849dac9b78b1b8f3058a9ce212326a85a (diff) | |
download | xmlgraphics-fop-2f633bd8c527829b187a9dbb2927373da600d247.tar.gz xmlgraphics-fop-2f633bd8c527829b187a9dbb2927373da600d247.zip |
Partial implementation of space-after functionality--mostly working, but
some remaining problems:
1.) relying on a static variable to carry space-after value from previous
block to current. (BlockLayoutManager is be instantiated for each block
instead of being in memory for all blocks--bad design?)
2.) The space-after of a block ending at the bottom of the page is not
currently being added to the beginning of the subsequent page.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197004 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop')
-rw-r--r-- | src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java index bc82ca467..24f1efee6 100644 --- a/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java @@ -85,7 +85,9 @@ public class BlockLayoutManager extends BlockStackingLayoutManager { used in rendering the fo:block. */ private MinOptMax foBlockSpaceBefore = null; - private MinOptMax foBlockSpaceAfter = null; // not currently implemented + // need to retain foBlockSpaceAfter from previous instantiation + private static MinOptMax foBlockSpaceAfter = null; + private MinOptMax prevFoBlockSpaceAfter = null; private int lead = 12000; private int lineHeight = 14000; @@ -181,6 +183,7 @@ public class BlockLayoutManager extends BlockStackingLayoutManager { borderProps = pm.getBorderAndPadding(); backgroundProps = pm.getBackgroundProps(); foBlockSpaceBefore = layoutProps.spaceBefore.getSpace(); + prevFoBlockSpaceAfter = foBlockSpaceAfter; } public BreakPoss getNextBreakPoss(LayoutContext context) { @@ -190,9 +193,14 @@ public class BlockLayoutManager extends BlockStackingLayoutManager { MinOptMax stackSize = new MinOptMax(); + if (prevFoBlockSpaceAfter != null) { + stackSize.add(prevFoBlockSpaceAfter); + prevFoBlockSpaceAfter = null; + } + if (foBlockSpaceBefore != null) { // this function called before addAreas(), so - // setting foBlockSpaceBefore = null *in* addAreas() + // resetting foBlockSpaceBefore = null in addAreas() stackSize.add(foBlockSpaceBefore); } @@ -308,7 +316,8 @@ public class BlockLayoutManager extends BlockStackingLayoutManager { flush(); // if adjusted space after - addBlockSpacing(adjust, layoutProps.spaceAfter.getSpace()); + foBlockSpaceAfter = layoutProps.spaceAfter.getSpace(); + addBlockSpacing(adjust, foBlockSpaceAfter); curBlockArea = null; } |