xmlgraphics-fop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acumis...@apache.org
Subject svn commit: r675502 - in /xmlgraphics/fop/branches/Temp_AFPGOCAResources: ./ src/java/org/apache/fop/render/java2d/Java2DRenderer.java
Date Thu, 10 Jul 2008 10:28:37 GMT
Author: acumiskey
Date: Thu Jul 10 03:28:37 2008
New Revision: 675502

URL: http://svn.apache.org/viewvc?rev=675502&view=rev
Log:
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.
........

Modified:
    xmlgraphics/fop/branches/Temp_AFPGOCAResources/   (props changed)
    xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/java2d/Java2DRenderer.java

Propchange: xmlgraphics/fop/branches/Temp_AFPGOCAResources/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Jul 10 03:28:37 2008
@@ -1 +1 @@
-/xmlgraphics/fop/trunk:1-675258
+/xmlgraphics/fop/trunk:1-675501

Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/java2d/Java2DRenderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/java2d/Java2DRenderer.java?rev=675502&r1=675501&r2=675502&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/java2d/Java2DRenderer.java
(original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/java2d/Java2DRenderer.java
Thu Jul 10 03:28:37 2008
@@ -185,12 +185,12 @@
      * @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 @@
         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 @@
 
             // 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 @@
     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 void setTransparentPageBackground(boolean transparentPageBackground) {
         this.transparentPageBackground = transparentPageBackground;
     }
-
 }



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


Mime
View raw message