aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2004-09-03 08:06:01 +0000
committerJeremias Maerki <jeremias@apache.org>2004-09-03 08:06:01 +0000
commit56969a0f394ee426345412c40d1023318631ed91 (patch)
tree3165554f1a599cc8ade59833026844faa0b5704d /src
parent251758435b08de7e1b58ee54658461bbb6f9f45b (diff)
downloadxmlgraphics-fop-56969a0f394ee426345412c40d1023318631ed91.tar.gz
xmlgraphics-fop-56969a0f394ee426345412c40d1023318631ed91.zip
Remove unnecessary scale factor. This made all images added via SVG three times bigger than they need to be. The scale factor doesn't exist in PSGraphics2D.
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
Diffstat (limited to 'src')
-rw-r--r--src/java/org/apache/fop/svg/PDFGraphics2D.java11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/java/org/apache/fop/svg/PDFGraphics2D.java b/src/java/org/apache/fop/svg/PDFGraphics2D.java
index 5514149d7..e8bddd53b 100644
--- a/src/java/org/apache/fop/svg/PDFGraphics2D.java
+++ b/src/java/org/apache/fop/svg/PDFGraphics2D.java
@@ -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();