diff options
author | Manuel Mall <manuel@apache.org> | 2005-10-14 13:20:53 +0000 |
---|---|---|
committer | Manuel Mall <manuel@apache.org> | 2005-10-14 13:20:53 +0000 |
commit | 7ce41696f38d92fb75cf6737674966e32351e00c (patch) | |
tree | 1294be67aa301a66cd7e92ca766c668f26a5c914 /src/java/org | |
parent | 64336ac4d35019d99a6634dbe5a36a65ac791175 (diff) | |
download | xmlgraphics-fop-7ce41696f38d92fb75cf6737674966e32351e00c.tar.gz xmlgraphics-fop-7ce41696f38d92fb75cf6737674966e32351e00c.zip |
Inline block parents were not correctly positioned when border/padding got involved - matched their positioning logic with the usual inlines
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@321108 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org')
3 files changed, 9 insertions, 0 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java index fdfcca373..ea1eb11a0 100755 --- a/src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java @@ -447,6 +447,13 @@ public class InlineLayoutManager extends InlineStackingLayoutManager { parent.setBPD(alignmentContext.getHeight()); if (parent instanceof InlineParent) { parent.setOffset(alignmentContext.getOffset()); + } else if (parent instanceof InlineBlockParent) { + // All inline elements are positioned by the renderers relative to + // the before edge of their content rectangle + if (borderProps != null) { + parent.setOffset(borderProps.getPaddingBefore(false, this) + + borderProps.getBorderBeforeWidth(false)); + } } setCurrentArea(parent); diff --git a/src/java/org/apache/fop/render/AbstractRenderer.java b/src/java/org/apache/fop/render/AbstractRenderer.java index 16c8f75ae..aceac1a87 100644 --- a/src/java/org/apache/fop/render/AbstractRenderer.java +++ b/src/java/org/apache/fop/render/AbstractRenderer.java @@ -662,6 +662,7 @@ public abstract class AbstractRenderer currentIPPosition += ibp.getBorderAndPaddingWidthStart(); // For inline content the BP position is updated by the enclosing line area int saveBP = currentBPPosition; + currentBPPosition += ibp.getOffset(); renderBlock(ibp.getChildArea()); currentBPPosition = saveBP; } diff --git a/src/java/org/apache/fop/render/xml/XMLRenderer.java b/src/java/org/apache/fop/render/xml/XMLRenderer.java index cedbb404f..71d47df40 100644 --- a/src/java/org/apache/fop/render/xml/XMLRenderer.java +++ b/src/java/org/apache/fop/render/xml/XMLRenderer.java @@ -638,6 +638,7 @@ public class XMLRenderer extends PrintRenderer { atts.clear(); addAreaAttributes(ibp); addTraitAttributes(ibp); + addAttribute("offset", ibp.getOffset()); startElement("inlineblockparent", atts); super.renderInlineBlockParent(ibp); endElement("inlineblockparent"); |