]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Draw the borders of a BlockViewport before setting the CTM
authorFinn Bock <bckfnn@apache.org>
Tue, 10 Feb 2004 19:28:17 +0000 (19:28 +0000)
committerFinn Bock <bckfnn@apache.org>
Tue, 10 Feb 2004 19:28:17 +0000 (19:28 +0000)
transformation. This way the viewport is relative to the current CTM
and the content of the Viewport is relative to the viewport CTM.

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197348 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/render/pdf/PDFRenderer.java

index a97bb68b9bbf7394db8e015241ffba0fc007f50e..aff723b94fd57c7fd3019ab3aa6d986940b7977a 100644 (file)
@@ -742,26 +742,29 @@ public class PDFRenderer extends PrintRenderer {
 
         if (bv.getPositioning() == Block.ABSOLUTE) {
 
-            currentIPPosition = 0;
-            currentBPPosition = 0;
-
             closeText();
-            endTextObject();
 
+            CTM tempctm = new CTM(containingIPPosition, containingBPPosition);
+            ctm = tempctm.multiply(ctm);
+
+            float x = (float)(bv.getXOffset() + containingIPPosition) / 1000f;
+            float y = (float)(bv.getYOffset() + containingBPPosition) / 1000f;
+            float width = (float)bv.getWidth() / 1000f;
+            float height = (float)bv.getHeight() / 1000f;
+            
+            drawBackAndBorders(bv, x, y, width, height);
+            
+            endTextObject();
             if (bv.getClip()) {
                 saveGraphicsState();
-                float x = (float)(bv.getXOffset() + containingIPPosition) / 1000f;
-                float y = (float)(bv.getYOffset() + containingBPPosition) / 1000f;
-                float width = (float)bv.getWidth() / 1000f;
-                float height = (float)bv.getHeight() / 1000f;
                 clip(x, y, width, height);
             }
 
-            CTM tempctm = new CTM(containingIPPosition, containingBPPosition);
-            ctm = tempctm.multiply(ctm);
-
             startVParea(ctm);
-            handleBlockTraits(bv);
+
+            currentIPPosition = 0;
+            currentBPPosition = 0;
+
             renderBlocks(bv, children);
             endVParea();
 
@@ -777,11 +780,7 @@ public class PDFRenderer extends PrintRenderer {
         } else {
 
             if (ctm != null) {
-                currentIPPosition = 0;
-                currentBPPosition = 0;
-
                 closeText();
-                endTextObject();
 
                 double[] vals = ctm.toArray();
                 //boolean aclock = vals[2] == 1.0;
@@ -798,7 +797,6 @@ public class PDFRenderer extends PrintRenderer {
             if (bv.getClip()) {
                 if (ctm == null) {
                     closeText();
-                    endTextObject();
                 }
                 saveGraphicsState();
                 float x = (float)bv.getXOffset() / 1000f;
@@ -808,10 +806,13 @@ public class PDFRenderer extends PrintRenderer {
                 clip(x, y, width, height);
             }
 
+            handleBlockTraits(bv);
             if (ctm != null) {
+                endTextObject();
                 startVParea(ctm);
+                currentIPPosition = 0;
+                currentBPPosition = 0;
             }
-            handleBlockTraits(bv);
             renderBlocks(bv, children);
             if (ctm != null) {
                 endVParea();