aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2005-08-12 08:23:57 +0000
committerJeremias Maerki <jeremias@apache.org>2005-08-12 08:23:57 +0000
commitc7a832a5ec3b521e06fa4215037d926e3d7cd941 (patch)
treee0f1edfcdd3d03ef6f89fba08675e1916cc775f8 /src/java/org
parent2d9ff680c29879463ef8ce5c4b6370d587e7333b (diff)
downloadxmlgraphics-fop-c7a832a5ec3b521e06fa4215037d926e3d7cd941.tar.gz
xmlgraphics-fop-c7a832a5ec3b521e06fa4215037d926e3d7cd941.zip
Bugzilla #36146
Image scaling didn't work in the Java2D based renderers, as the putImage function was referring to the wrong height/width. Submitted by: Richard Wheeldon <richardw.at.geoquip-rnd.demon.co.uk> git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@232234 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org')
-rw-r--r--src/java/org/apache/fop/render/java2d/Java2DRenderer.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/java/org/apache/fop/render/java2d/Java2DRenderer.java b/src/java/org/apache/fop/render/java2d/Java2DRenderer.java
index 310162653..b3ae1a47a 100644
--- a/src/java/org/apache/fop/render/java2d/Java2DRenderer.java
+++ b/src/java/org/apache/fop/render/java2d/Java2DRenderer.java
@@ -986,8 +986,9 @@ public abstract class Java2DRenderer extends AbstractRenderer implements Printab
// url = "C:/eclipse/myWorkbenches/fop4/xml-fop/examples/fo" + url;
java.awt.Image awtImage = new javax.swing.ImageIcon(url).getImage();
- state.getGraph().drawImage(awtImage, (int) (x / 1000f),
- (int) (y / 1000f), (int) w, h, null);
+ state.getGraph().drawImage(awtImage,
+ (int)(x / 1000f), (int)(y / 1000f),
+ (int)(pos.getWidth() / 1000f), (int)(pos.getHeight() / 1000f), null);
currentBPPosition += (h * 1000);
} else {
if (!fopimage.load(FopImage.BITMAP)) {
@@ -1014,8 +1015,9 @@ public abstract class Java2DRenderer extends AbstractRenderer implements Printab
// Combine the color model and raster into a buffered image
awtImage = new BufferedImage(cm, raster, false, null);
- state.getGraph().drawImage(awtImage, (int) (x / 1000f),
- (int) (y / 1000f), (int) w, h, null);
+ state.getGraph().drawImage(awtImage,
+ (int)(x / 1000f), (int)(y / 1000f),
+ (int)(pos.getWidth() / 1000f), (int)(pos.getHeight() / 1000f), null);
currentBPPosition += (h * 1000);
}
}