keiron      2002/07/10 01:22:25

  Modified:    src/org/apache/fop/svg PDFGraphics2D.java
               test/resources/fop/svg paints.svg
  Log:
  improved patterns, the contents should be visible now
  
  Revision  Changes    Path
  1.37      +16 -12    xml-fop/src/org/apache/fop/svg/PDFGraphics2D.java
  
  Index: PDFGraphics2D.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/svg/PDFGraphics2D.java,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- PDFGraphics2D.java        9 Jul 2002 14:59:03 -0000       1.36
  +++ PDFGraphics2D.java        10 Jul 2002 08:22:24 -0000      1.37
  @@ -768,7 +768,7 @@
               // this makes the pattern the right way up, since
               // it is outside the original transform around the
               // whole svg document
  -            pattStream.write("1 0 0 -1 0 " + rect.getHeight() + " cm\n");
  +            pattStream.write("1 0 0 -1 0 " + (rect.getHeight() + rect.getY()) + " 
cm\n");
   
               pattStream.write(pattGraphic.getString());
               pattStream.write("Q");
  @@ -776,16 +776,20 @@
               ArrayList bbox = new ArrayList();
               bbox.add(new Double(0));
               bbox.add(new Double(0));
  -            bbox.add(new Double(rect.getWidth()));
  -            bbox.add(new Double(rect.getHeight()));
  +            bbox.add(new Double(rect.getWidth() + rect.getX()));
  +            bbox.add(new Double(rect.getHeight() + rect.getY()));
  +
               ArrayList translate = new ArrayList();
  -            // TODO combine with pattern transform
  -            translate.add(new Double(1));
  -            translate.add(new Double(0));
  -            translate.add(new Double(0));
  -            translate.add(new Double(1));
  -            translate.add(new Double(0/*rect.getX()*/));
  -            translate.add(new Double(0/*rect.getY()*/));
  +            AffineTransform pattt = pp.getPatternTransform();
  +            pattt.translate(rect.getWidth() + rect.getX(), rect.getHeight() + 
rect.getY());
  +            double[] flatmatrix = new double[6];
  +            pattt.getMatrix(flatmatrix);
  +            translate.add(new Double(flatmatrix[0]));
  +            translate.add(new Double(flatmatrix[1]));
  +            translate.add(new Double(flatmatrix[2]));
  +            translate.add(new Double(flatmatrix[3]));
  +            translate.add(new Double(flatmatrix[4]));
  +            translate.add(new Double(flatmatrix[5]));
   
               FontSetup.addToResources(pdfDoc, res, fi);
   
  
  
  
  1.3       +3 -2      xml-fop/test/resources/fop/svg/paints.svg
  
  Index: paints.svg
  ===================================================================
  RCS file: /home/cvs/xml-fop/test/resources/fop/svg/paints.svg,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- paints.svg        28 Jun 2002 06:21:29 -0000      1.2
  +++ paints.svg        10 Jul 2002 08:22:24 -0000      1.3
  @@ -16,14 +16,16 @@
           </linearGradient>
           <linearGradient id="grad2" x1="0" y1="0" x2="0" y2="1">
                   <stop offset="0" style="stop-color:crimson" />
  +                <stop offset="0.4" style="stop-color:purple" />
                   <stop offset="1" style="stop-color:gold" />
           </linearGradient>
           <linearGradient id="grad3" x1="0" y1="0" x2="1" y2="1">
                   <stop offset="0" style="stop-color:crimson" />
  +                <stop offset="0.7" style="stop-color:blue" />
                   <stop offset="1" style="stop-color:gold" />
           </linearGradient>
           <radialGradient id="rad"
  -            fx="20%" fy="0%" rx="10%" ry="30%" r="40%">
  +            fx="20%" fy="30%" rx="10%" ry="30%" r="40%">
               <stop offset="0" stop-color="gold" />
               <stop offset="1" stop-color="green" stop-opacity="0.4"/>
           </radialGradient>
  @@ -32,7 +34,6 @@
       <rect x="15" y="117.5" width="100" height="75" style="fill:url(#grad2)" />
       <rect x="15" y="195" width="100" height="75" style="fill:url(#grad3)" />
       <rect x="15" y="275" width="100" height="75" style="fill:url(#rad)" />
  -
   
   <text x="120" y="35" style="font-size:12">Pattern</text>
   
  
  
  

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

Reply via email to