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 bc...@apache.org on 2004/01/29 20:43:05 UTC
cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr BlockContainerLayoutManager.java BlockLayoutManager.java
bckfnn 2004/01/29 11:43:05
Modified: src/java/org/apache/fop/layoutmgr
BlockContainerLayoutManager.java
BlockLayoutManager.java
Log:
Set the SPACE_START and SPACE_END traits and adjust the height to take
border and padding into account.
PR: 25802.
Revision Changes Path
1.12 +13 -2 xml-fop/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java
Index: BlockContainerLayoutManager.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- BlockContainerLayoutManager.java 17 Jan 2004 19:29:46 -0000 1.11
+++ BlockContainerLayoutManager.java 29 Jan 2004 19:43:04 -0000 1.12
@@ -58,6 +58,8 @@
import org.apache.fop.area.Block;
import org.apache.fop.fo.PropertyManager;
import org.apache.fop.fo.properties.CommonAbsolutePosition;
+import org.apache.fop.fo.properties.CommonBorderAndPadding;
+import org.apache.fop.fo.properties.CommonMarginBlock;
import org.apache.fop.fo.PropertyList;
import org.apache.fop.area.CTM;
import org.apache.fop.datatypes.FODimension;
@@ -75,6 +77,8 @@
private List childBreaks = new java.util.ArrayList();
private CommonAbsolutePosition abProps;
+ private CommonBorderAndPadding borderProps;
+ private CommonMarginBlock marginProps;
private FODimension relDims;
private CTM absoluteCTM;
private boolean clip = false;
@@ -105,6 +109,8 @@
absoluteCTM = CTM.getCTMandRelDims(pm.getAbsRefOrient(),
pm.getWritingMode(), rect, relDims);
}
+ marginProps = pm.getMarginProps();
+ borderProps = pm.getBorderAndPadding();
height = pm.getPropertyList().get(PR_HEIGHT).getLength();
width = pm.getPropertyList().get(PR_WIDTH).getLength();
}
@@ -123,19 +129,24 @@
return getAbsoluteBreakPoss(context);
}
+ int bIndents = borderProps.getBPPaddingAndBorder(false);
+ int iIndents = marginProps.startIndent + marginProps.endIndent;
+
int ipd = context.getRefIPD();
int bpd = context.getStackLimit().opt;
if (!width.isAuto()) {
- ipd = width.getValue();
+ ipd = width.getValue() + iIndents;
}
if (!height.isAuto()) {
- bpd = height.getValue();
+ bpd = height.getValue() + bIndents;
}
Rectangle2D rect = new Rectangle2D.Double(0, 0, ipd, bpd);
relDims = new FODimension(0, 0);
absoluteCTM = CTM.getCTMandRelDims(propManager.getAbsRefOrient(),
propManager.getWritingMode(), rect, relDims);
double[] vals = absoluteCTM.toArray();
+
+ ipd -= iIndents;
MinOptMax stackLimit;
boolean rotated = vals[0] == 0.0;
1.12 +9 -3 xml-fop/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java
Index: BlockLayoutManager.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- BlockLayoutManager.java 30 Dec 2003 23:11:00 -0000 1.11
+++ BlockLayoutManager.java 29 Jan 2004 19:43:05 -0000 1.12
@@ -63,6 +63,7 @@
import org.apache.fop.traits.LayoutProps;
import org.apache.fop.fo.properties.CommonBorderAndPadding;
import org.apache.fop.fo.properties.CommonBackground;
+import org.apache.fop.fo.properties.CommonMarginBlock;
import org.apache.fop.traits.MinOptMax;
/**
@@ -75,6 +76,7 @@
private LayoutProps layoutProps;
private CommonBorderAndPadding borderProps;
private CommonBackground backgroundProps;
+ private CommonMarginBlock marginProps;
/* holds the (one-time use) fo:block space-before
and -after properties. Large fo:blocks are split
@@ -182,6 +184,7 @@
layoutProps = pm.getLayoutProps();
borderProps = pm.getBorderAndPadding();
backgroundProps = pm.getBackgroundProps();
+ marginProps = pm.getMarginProps();
foBlockSpaceBefore = layoutProps.spaceBefore.getSpace();
prevFoBlockSpaceAfter = foBlockSpaceAfter;
}
@@ -190,8 +193,8 @@
LayoutProcessor curLM; // currently active LM
int ipd = context.getRefIPD();
- int iIndents = borderProps.getPaddingStart(false)
- + borderProps.getPaddingEnd(false);
+ int iIndents = marginProps.startIndent + marginProps.endIndent;
+ int bIndents = borderProps.getBPPaddingAndBorder(false);
ipd -= iIndents;
MinOptMax stackSize = new MinOptMax();
@@ -206,7 +209,7 @@
// resetting foBlockSpaceBefore = null in addAreas()
stackSize.add(foBlockSpaceBefore);
}
-
+
BreakPoss lastPos = null;
while ((curLM = getChildLM()) != null) {
@@ -313,6 +316,8 @@
}
}
+ int bIndents = borderProps.getBPPaddingAndBorder(false);
+ curBlockArea.setHeight(curBlockArea.getHeight() + bIndents);
addMarkers(false, true);
@@ -342,6 +347,7 @@
// set traits
TraitSetter.addBorders(curBlockArea, borderProps);
TraitSetter.addBackground(curBlockArea, backgroundProps);
+ TraitSetter.addMargins(curBlockArea, borderProps, marginProps);
// Set up dimensions
// Must get dimensions from parent area
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-cvs-help@xml.apache.org