]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Remove unnecessary scale factor. This made all images added via SVG three times bigge...
authorJeremias Maerki <jeremias@apache.org>
Fri, 3 Sep 2004 08:06:01 +0000 (08:06 +0000)
committerJeremias Maerki <jeremias@apache.org>
Fri, 3 Sep 2004 08:06:01 +0000 (08:06 +0000)
Here's where this scale factor was introduced:
http://cvs.apache.org/viewcvs.cgi/xml-fop/src/org/apache/fop/svg/Attic/PDFGraphics2D.java?r1=1.18&r2=1.19&diff_format=h
Also reported by Jay Chiu for Fop 0.20.5 (Feb 2004)

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

src/java/org/apache/fop/svg/PDFGraphics2D.java

index 5514149d7d6df90df8867ec5538411b63ef22f9b..e8bddd53b67c4b2c45a0e87f5dbbaae4f0ed0a02 100644 (file)
@@ -437,17 +437,14 @@ public class PDFGraphics2D extends AbstractGraphics2D {
         if (imageInfo == null) {
             // OK, have to build and add a PDF image
 
-            // scale factor
-            final int scaleFactor = 3;
-
-            Dimension size = new Dimension(width * scaleFactor, height * scaleFactor);
+            Dimension size = new Dimension(width, height);
             BufferedImage buf = buildBufferedImage(size);
 
             java.awt.Graphics2D g = buf.createGraphics();
             g.setComposite(AlphaComposite.SrcOver);
             g.setBackground(new Color(1, 1, 1, 0));
             g.setPaint(new Color(1, 1, 1, 0));
-            g.fillRect(0, 0, width * scaleFactor, height * scaleFactor);
+            g.fillRect(0, 0, width, height);
             g.clip(new Rectangle(0, 0, buf.getWidth(), buf.getHeight()));
             g.setComposite(gc.getComposite());
 
@@ -456,7 +453,7 @@ public class PDFGraphics2D extends AbstractGraphics2D {
             }
             g.dispose();
 
-            final byte[] result = new byte[buf.getWidth() * buf.getHeight() * 3];
+            final byte[] result = new byte[buf.getWidth() * buf.getHeight() * 3 /*for RGB*/];
             byte[] mask = new byte[buf.getWidth() * buf.getHeight()];
             boolean hasMask = false;
             //boolean binaryMask = true;
@@ -467,7 +464,7 @@ public class PDFGraphics2D extends AbstractGraphics2D {
             int count = 0;
             int maskpos = 0;
             int[] iarray;
-            int i, j, val, alpha, add, mult;
+            int i, j, val, alpha;
             switch (bd.getDataType()) {
                 case DataBuffer.TYPE_INT:
                 int[][] idata = ((DataBufferInt)bd).getBankData();