diff options
author | Karen Lease <klease@apache.org> | 2001-07-20 21:00:08 +0000 |
---|---|---|
committer | Karen Lease <klease@apache.org> | 2001-07-20 21:00:08 +0000 |
commit | 5d62e521abe65d9496e8f4741f3b56b5ac9ff7fd (patch) | |
tree | 21a1622e9057bc91a143aa148935254e891d93e7 /src/org/apache/fop/fo/flow/TableCell.java | |
parent | 2a5a4e7774960ddb0287bd8dd84747669abf45e1 (diff) | |
download | xmlgraphics-fop-5d62e521abe65d9496e8f4741f3b56b5ac9ff7fd.tar.gz xmlgraphics-fop-5d62e521abe65d9496e8f4741f3b56b5ac9ff7fd.zip |
Fix some bugs in table and cell border drawing and cell width calculations
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194362 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/fo/flow/TableCell.java')
-rw-r--r-- | src/org/apache/fop/fo/flow/TableCell.java | 39 |
1 files changed, 27 insertions, 12 deletions
diff --git a/src/org/apache/fop/fo/flow/TableCell.java b/src/org/apache/fop/fo/flow/TableCell.java index b1cab472b..c5a8a0676 100644 --- a/src/org/apache/fop/fo/flow/TableCell.java +++ b/src/org/apache/fop/fo/flow/TableCell.java @@ -40,13 +40,25 @@ public class TableCell extends FObj { */ protected int startOffset; - /** Dimension of content rectangle in inline-progression-direction */ + /** Dimension of allocation rectangle in inline-progression-direction, + * determined by the width of the column(s) occupied by the cell + */ protected int width; /** Offset of content rectangle, in block-progression-direction, * relative to the row. */ - protected int beforeOffset; + protected int beforeOffset=0; + + /** Offset of content rectangle, in inline-progression-direction, + * relative to the column start edge. + */ + protected int startAdjust=0; + + /** Adjust to theoretical column width to obtain content width + * relative to the column start edge. + */ + protected int widthAdjust=0; /* For collapsed border style */ protected int borderHeight = 0; @@ -120,6 +132,9 @@ public class TableCell extends FObj { bSepBorders = (this.properties.get("border-collapse").getEnum() == BorderCollapse.SEPARATE); + + calcBorders(propMgr.getBorderAndPadding()); + // Vertical cell alignment verticalAlign = this.properties.get("display-align").getEnum(); if (verticalAlign == DisplayAlign.AUTO) { @@ -145,7 +160,7 @@ public class TableCell extends FObj { // } // Calculate cell borders - calcBorders(propMgr.getBorderAndPadding()); + // calcBorders(propMgr.getBorderAndPadding()); area.getIDReferences().createID(id); @@ -169,8 +184,9 @@ public class TableCell extends FObj { // and padding are outside of this rectangle. this.cellArea = new AreaContainer(propMgr.getFontState(area.getFontInfo()), - startOffset, beforeOffset, - width, spaceLeft, + startOffset+startAdjust, + beforeOffset, + width-widthAdjust, spaceLeft, Position.RELATIVE); cellArea.foCreator=this; // G Seshadri @@ -306,15 +322,14 @@ public class TableCell extends FObj { * but it inherits. */ int iSep = properties.get("border-separation.inline-progression-direction").getLength().mvalue(); - int contentOffset = iSep/2 + bp.getBorderLeftWidth(false) + + this.startAdjust = iSep/2 + bp.getBorderLeftWidth(false) + bp.getPaddingLeft(false); /* int contentOffset = iSep + bp.getBorderStartWidth(false) + bp.getPaddingStart(false); */ - this.startOffset += contentOffset; - this.width -= (contentOffset + iSep - iSep/2 + - bp.getBorderRightWidth(false) + bp.getPaddingRight(false)); + this.widthAdjust = startAdjust + iSep - iSep/2 + + bp.getBorderRightWidth(false) + bp.getPaddingRight(false); // bp.getBorderEndWidth(false) + bp.getPaddingEnd(false); // Offset of content rectangle in the block-progression direction m_borderSeparation = @@ -376,10 +391,10 @@ public class TableCell extends FObj { int borderBefore = bp.getBorderTopWidth(false); int borderAfter = bp.getBorderBottomWidth(false); - int contentOffset = borderStart/2 + bp.getPaddingLeft(false); + this.startAdjust = borderStart/2 + bp.getPaddingLeft(false); - this.startOffset += contentOffset; - this.width -= (contentOffset + borderEnd/2 + bp.getPaddingRight(false)); + this.widthAdjust = startAdjust + borderEnd/2 + + bp.getPaddingRight(false); this.beforeOffset = borderBefore/2 + bp.getPaddingTop(false); // Half border height to fix overestimate of area size! this.borderHeight = (borderBefore + borderAfter)/2; |