You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by je...@apache.org on 2007/12/19 16:03:26 UTC

svn commit: r605567 - in /xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/image2/impl/batik: ImageConverterSVG2G2D.java ImageConverterWMF2G2D.java

Author: jeremias
Date: Wed Dec 19 07:03:25 2007
New Revision: 605567

URL: http://svn.apache.org/viewvc?rev=605567&view=rev
Log:
Fixed scaling and translation (didn't work correctly in certain situations)

Modified:
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/image2/impl/batik/ImageConverterSVG2G2D.java
    xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/image2/impl/batik/ImageConverterWMF2G2D.java

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/image2/impl/batik/ImageConverterSVG2G2D.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/image2/impl/batik/ImageConverterSVG2G2D.java?rev=605567&r1=605566&r2=605567&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/image2/impl/batik/ImageConverterSVG2G2D.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/image2/impl/batik/ImageConverterSVG2G2D.java Wed Dec 19 07:03:25 2007
@@ -91,6 +91,7 @@
                 float ih = (float) ctx.getDocumentSize().getHeight();
                 float w = (float) area.getWidth();
                 float h = (float) area.getHeight();
+                g2d.translate(area.getX(), area.getY());
                 g2d.scale(w / iw, h / ih);
 
                 root.paint(g2d);

Modified: xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/image2/impl/batik/ImageConverterWMF2G2D.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/image2/impl/batik/ImageConverterWMF2G2D.java?rev=605567&r1=605566&r2=605567&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/image2/impl/batik/ImageConverterWMF2G2D.java (original)
+++ xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/image2/impl/batik/ImageConverterWMF2G2D.java Wed Dec 19 07:03:25 2007
@@ -21,7 +21,6 @@
 
 import java.awt.Dimension;
 import java.awt.Graphics2D;
-import java.awt.geom.Dimension2D;
 import java.awt.geom.Rectangle2D;
 import java.util.Map;
 
@@ -87,15 +86,9 @@
             double h = area.getHeight();
             
             //Fit in paint area
-            Dimension2D imageSize = wmf.getSize().getDimensionPt();
-            double sx = w / imageSize.getWidth();
-            double sy = h / imageSize.getHeight();
-            if (sx != 1.0 || sy != 1.0) {
-                g2d.scale(sx, sy);
-            }
-            //Scale WMF to fit
-            sx = w / wmfStore.getWidthPixels();
-            sy = h / wmfStore.getHeightPixels();
+            g2d.translate(area.getX(), area.getY());
+            double sx = w / wmfStore.getWidthPixels();
+            double sy = h / wmfStore.getHeightPixels();
             if (sx != 1.0 || sy != 1.0) {
                 g2d.scale(sx, sy);
             }



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org