aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Cumiskey <acumiskey@apache.org>2008-07-10 10:28:37 +0000
committerAdrian Cumiskey <acumiskey@apache.org>2008-07-10 10:28:37 +0000
commit28c0a5eee984d43c7a78b426c2d330a0f40e9b22 (patch)
tree844b8a6fba45b1b947a923661aba186b1df44aba
parentc7332c147a93181a8f7762f7425d0373810e1d21 (diff)
downloadxmlgraphics-fop-28c0a5eee984d43c7a78b426c2d330a0f40e9b22.tar.gz
xmlgraphics-fop-28c0a5eee984d43c7a78b426c2d330a0f40e9b22.zip
Merged revisions 675501 via svnmerge from
https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk ........ r675501 | acumiskey | 2008-07-10 11:23:54 +0100 (Thu, 10 Jul 2008) | 2 lines Duplicated operation scaleX and scaleY replaced simply with scale. ........ git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AFPGOCAResources@675502 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/java/org/apache/fop/render/java2d/Java2DRenderer.java30
1 files changed, 13 insertions, 17 deletions
diff --git a/src/java/org/apache/fop/render/java2d/Java2DRenderer.java b/src/java/org/apache/fop/render/java2d/Java2DRenderer.java
index 7cb9268f0..6fff05c29 100644
--- a/src/java/org/apache/fop/render/java2d/Java2DRenderer.java
+++ b/src/java/org/apache/fop/render/java2d/Java2DRenderer.java
@@ -185,12 +185,12 @@ public abstract class Java2DRenderer extends AbstractPathOrientedRenderer implem
* @param newScaleFactor ]0 ; 1]
*/
public void setScaleFactor(double newScaleFactor) {
- scaleFactor = newScaleFactor;
+ this.scaleFactor = newScaleFactor;
}
/** @return the scale factor */
public double getScaleFactor() {
- return scaleFactor;
+ return this.scaleFactor;
}
/** {@inheritDoc} */
@@ -288,22 +288,19 @@ public abstract class Java2DRenderer extends AbstractPathOrientedRenderer implem
this.currentPageViewport = pageViewport;
try {
Rectangle2D bounds = pageViewport.getViewArea();
- pageWidth = (int) Math.round(bounds.getWidth() / 1000f);
- pageHeight = (int) Math.round(bounds.getHeight() / 1000f);
+ this.pageWidth = (int) Math.round(bounds.getWidth() / 1000f);
+ this.pageHeight = (int) Math.round(bounds.getHeight() / 1000f);
log.info(
"Rendering Page " + pageViewport.getPageNumberString()
+ " (pageWidth " + pageWidth + ", pageHeight "
+ pageHeight + ")");
- double scaleX = scaleFactor
- * (25.4 / FopFactoryConfigurator.DEFAULT_TARGET_RESOLUTION)
+ double scale = scaleFactor
+ * (25.4f / FopFactoryConfigurator.DEFAULT_TARGET_RESOLUTION)
/ userAgent.getTargetPixelUnitToMillimeter();
- double scaleY = scaleFactor
- * (25.4 / FopFactoryConfigurator.DEFAULT_TARGET_RESOLUTION)
- / userAgent.getTargetPixelUnitToMillimeter();
- int bitmapWidth = (int) ((pageWidth * scaleX) + 0.5);
- int bitmapHeight = (int) ((pageHeight * scaleY) + 0.5);
+ int bitmapWidth = (int) ((pageWidth * scale) + 0.5);
+ int bitmapHeight = (int) ((pageHeight * scale) + 0.5);
BufferedImage currentPageImage = getBufferedImage(bitmapWidth, bitmapHeight);
@@ -326,7 +323,7 @@ public abstract class Java2DRenderer extends AbstractPathOrientedRenderer implem
// transform page based on scale factor supplied
AffineTransform at = graphics.getTransform();
- at.scale(scaleX, scaleY);
+ at.scale(scale, scale);
graphics.setTransform(at);
// draw page frame
@@ -455,11 +452,11 @@ public abstract class Java2DRenderer extends AbstractPathOrientedRenderer implem
protected void restoreStateStackAfterBreakOut(List breakOutList) {
log.debug("Block.FIXED --> restoring context after break-out");
- Iterator i = breakOutList.iterator();
- while (i.hasNext()) {
- Java2DGraphicsState s = (Java2DGraphicsState)i.next();
+ Iterator it = breakOutList.iterator();
+ while (it.hasNext()) {
+ Java2DGraphicsState s = (Java2DGraphicsState)it.next();
stateStack.push(state);
- state = s;
+ this.state = s;
}
}
@@ -982,5 +979,4 @@ public abstract class Java2DRenderer extends AbstractPathOrientedRenderer implem
public void setTransparentPageBackground(boolean transparentPageBackground) {
this.transparentPageBackground = transparentPageBackground;
}
-
}