jeremias    2005/01/18 01:40:01

  Modified:    src/java/org/apache/fop/render/pdf PDFRenderer.java
  Log:
  Code cleanup and preparation for implementing absolute-position="fixed".
  
  Revision  Changes    Path
  1.70      +6 -22     
xml-fop/src/java/org/apache/fop/render/pdf/PDFRenderer.java
  
  Index: PDFRenderer.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/render/pdf/PDFRenderer.java,v
  retrieving revision 1.69
  retrieving revision 1.70
  diff -u -r1.69 -r1.70
  --- PDFRenderer.java  18 Jan 2005 07:00:14 -0000      1.69
  +++ PDFRenderer.java  18 Jan 2005 09:40:01 -0000      1.70
  @@ -49,7 +49,6 @@
   import org.apache.fop.area.OffDocumentItem;
   import org.apache.fop.area.BookmarkData;
   import org.apache.fop.area.inline.Character;
  -import org.apache.fop.area.inline.InlineArea;
   import org.apache.fop.area.inline.TextArea;
   import org.apache.fop.area.inline.Viewport;
   import org.apache.fop.area.inline.ForeignObject;
  @@ -197,7 +196,7 @@
       /**
        * reusable word area string buffer to reduce memory usage
        */
  -    private StringBuffer wordAreaPDF = new StringBuffer();
  +    //private StringBuffer wordAreaPDF = new StringBuffer();
   
       /**
        * create the PDF renderer
  @@ -274,7 +273,6 @@
           currentPage = null;
           currentState = null;
           currentFontName = "";
  -        wordAreaPDF = new StringBuffer();
       }
   
       /**
  @@ -677,22 +675,21 @@
           CTM ctm = bv.getCTM();
           int borderPaddingStart = bv.getBorderAndPaddingWidthStart();
           int borderPaddingBefore = bv.getBorderAndPaddingWidthBefore();
  -        float x,y;
  +        float x, y;
           x = (float)(bv.getXOffset() + containingIPPosition) / 1000f;
           y = (float)(bv.getYOffset() + containingBPPosition) / 1000f;
   
           if (bv.getPositioning() == Block.ABSOLUTE
                   || bv.getPositioning() == Block.FIXED) {
   
  -            getLogger().debug("containing position ip=" + 
containingIPPosition + " bp=" + containingBPPosition);
  +            //TODO Handle positioning=FIXED
  +            
               CTM tempctm = new CTM(containingIPPosition, 
containingBPPosition);
               ctm = tempctm.multiply(ctm);
  -            getLogger().debug("tempctm=" + tempctm + " ctm=" + ctm);
   
               //This is the content-rect
               float width = (float)bv.getIPD() / 1000f;
               float height = (float)bv.getBPD() / 1000f;
  -            getLogger().debug("renderBlockViewport: x=" + x + " y=" + y + " 
width=" + width + " height=" + height);
               
               //Adjust for spaces (from margin or indirectly by start-indent 
etc.
               Integer spaceStart = (Integer) bv.getTrait(Trait.SPACE_START);
  @@ -746,21 +743,6 @@
   
               CTM tempctm = new CTM(containingIPPosition, currentBPPosition + 
containingBPPosition);
               ctm = tempctm.multiply(ctm);
  -            /*
  -            if (ctm != null) {
  -                double[] vals = ctm.toArray();
  -                //boolean aclock = vals[2] == 1.0;
  -                if (vals[2] == 1.0) {
  -                    ctm = ctm.translate(-saveBP - bv.getBPD(), -saveIP);
  -                } else if (vals[0] == -1.0) {
  -                    ctm = ctm.translate(-saveIP - bv.getIPD(), -saveBP - 
bv.getBPD());
  -                } else {
  -                    //ctm = ctm.translate(saveBP, saveIP - bv.getIPD());
  -                    //ctm = ctm.translate(saveIP, saveBP);
  -                }
  -            }
  -            ctm = new CTM().translate(saveIP, saveBP).multiply(ctm);
  -            */
               
               //Now adjust for border/padding
               x += borderPaddingStart / 1000f;
  @@ -790,6 +772,8 @@
   
               currentIPPosition = saveIP;
               currentBPPosition = saveBP;
  +            
  +            //Adjust BP position (alloc BPD + spaces)
               if (spaceBefore != null) {
                   currentBPPosition += spaceBefore.intValue();
               }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to