aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache
diff options
context:
space:
mode:
authorAdrian Cumiskey <acumiskey@apache.org>2008-10-21 09:22:26 +0000
committerAdrian Cumiskey <acumiskey@apache.org>2008-10-21 09:22:26 +0000
commit94f68ab093975ecbf4fd69fc0e15e806863f677a (patch)
tree8f47cc42c3bd5234dbe8f6928b837ced40f620a2 /src/java/org/apache
parentd9e4553fcf9567ef9674be9f8dcdc6ac92232b06 (diff)
downloadxmlgraphics-fop-94f68ab093975ecbf4fd69fc0e15e806863f677a.tar.gz
xmlgraphics-fop-94f68ab093975ecbf4fd69fc0e15e806863f677a.zip
Fix for block container absolute positioning reference orientation.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AFPGOCAResources@706558 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache')
-rw-r--r--src/java/org/apache/fop/render/AbstractPathOrientedRenderer.java31
1 files changed, 21 insertions, 10 deletions
diff --git a/src/java/org/apache/fop/render/AbstractPathOrientedRenderer.java b/src/java/org/apache/fop/render/AbstractPathOrientedRenderer.java
index 38f532b4e..0496cf740 100644
--- a/src/java/org/apache/fop/render/AbstractPathOrientedRenderer.java
+++ b/src/java/org/apache/fop/render/AbstractPathOrientedRenderer.java
@@ -484,11 +484,7 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer {
int saveBP = currentBPPosition;
CTM ctm = bv.getCTM();
- int borderPaddingStart = bv.getBorderAndPaddingWidthStart();
int borderPaddingBefore = bv.getBorderAndPaddingWidthBefore();
- //This is the content-rect
- float width = bv.getIPD() / 1000f;
- float height = bv.getBPD() / 1000f;
if (bv.getPositioning() == Block.ABSOLUTE
|| bv.getPositioning() == Block.FIXED) {
@@ -504,6 +500,8 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer {
AffineTransform positionTransform = new AffineTransform();
positionTransform.translate(bv.getXOffset(), bv.getYOffset());
+ int borderPaddingStart = bv.getBorderAndPaddingWidthStart();
+
//"left/"top" (bv.getX/YOffset()) specify the position of the content rectangle
positionTransform.translate(-borderPaddingStart, -borderPaddingBefore);
@@ -520,15 +518,24 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer {
establishTransformationMatrix(positionTransform);
}
+ //This is the content-rect
+ float width = bv.getIPD() / 1000f;
+ float height = bv.getBPD() / 1000f;
+
//Background and borders
- float bpwidth = (borderPaddingStart + bv.getBorderAndPaddingWidthEnd()) / 1000f;
- float bpheight = (borderPaddingBefore + bv.getBorderAndPaddingWidthAfter()) / 1000f;
- drawBackAndBorders(bv, 0, 0, width + bpwidth, height + bpheight);
+ float borderPaddingWidth
+ = (borderPaddingStart + bv.getBorderAndPaddingWidthEnd()) / 1000f;
+ float borderPaddingHeight
+ = (borderPaddingBefore + bv.getBorderAndPaddingWidthAfter()) / 1000f;
+ drawBackAndBorders(bv, 0, 0, width + borderPaddingWidth, height + borderPaddingHeight);
//Shift to content rectangle after border painting
AffineTransform contentRectTransform = new AffineTransform();
contentRectTransform.translate(borderPaddingStart, borderPaddingBefore);
- concatenateTransformationMatrix(UnitConv.mptToPt(contentRectTransform));
+
+ if (!contentRectTransform.isIdentity()) {
+ establishTransformationMatrix(contentRectTransform);
+ }
//Clipping
if (bv.getClip()) {
@@ -545,11 +552,15 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer {
currentBPPosition = 0;
renderBlocks(bv, children);
- if (!positionTransform.isIdentity()) {
+ if (!contentTransform.isIdentity()) {
restoreGraphicsState();
}
- if (!contentTransform.isIdentity()) {
+ if (!contentRectTransform.isIdentity()) {
+ restoreGraphicsState();
+ }
+
+ if (!positionTransform.isIdentity()) {
restoreGraphicsState();
}