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;
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;
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();
}
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);
propManager.getWritingMode(), rect, relDims);
double[] vals = absoluteCTM.toArray();
+ ipd -= iIndents;
+
MinOptMax stackLimit;
boolean rotated = vals[0] == 0.0;
if (rotated) {
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;
/**
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
layoutProps = pm.getLayoutProps();
borderProps = pm.getBorderAndPadding();
backgroundProps = pm.getBackgroundProps();
+ marginProps = pm.getMarginProps();
foBlockSpaceBefore = layoutProps.spaceBefore.getSpace();
prevFoBlockSpaceAfter = foBlockSpaceAfter;
}
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();
// resetting foBlockSpaceBefore = null in addAreas()
stackSize.add(foBlockSpaceBefore);
}
-
+
BreakPoss lastPos = null;
while ((curLM = getChildLM()) != null) {
}
}
+ int bIndents = borderProps.getBPPaddingAndBorder(false);
+ curBlockArea.setHeight(curBlockArea.getHeight() + bIndents);
addMarkers(false, true);
// set traits
TraitSetter.addBorders(curBlockArea, borderProps);
TraitSetter.addBackground(curBlockArea, backgroundProps);
+ TraitSetter.addMargins(curBlockArea, borderProps, marginProps);
// Set up dimensions
// Must get dimensions from parent area