xmlgraphics-fop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cbowdi...@apache.org
Subject svn commit: r894350 - in /xmlgraphics/fop/trunk: src/java/org/apache/fop/afp/DataStream.java src/java/org/apache/fop/render/afp/AFPPainter.java src/java/org/apache/fop/render/afp/AFPRenderer.java status.xml
Date Tue, 29 Dec 2009 11:00:42 GMT
Author: cbowditch
Date: Tue Dec 29 11:00:41 2009
New Revision: 894350

URL: http://svn.apache.org/viewvc?rev=894350&view=rev
Log:
Bugfix: 48453 AFP Renderer: Page Segments not positioned correctly when reference-orientation
!= 0

Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/DataStream.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/AFPPainter.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/AFPRenderer.java
    xmlgraphics/fop/trunk/status.xml

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/DataStream.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/DataStream.java?rev=894350&r1=894349&r2=894350&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/DataStream.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/DataStream.java Tue Dec 29 11:00:41
2009
@@ -512,23 +512,27 @@
      *            the x coordinate for the overlay
      * @param y
      *            the y coordinate for the overlay
+     * @param width
+     *            the width of the image
+     * @param height
+     *            the height of the image
      */
-    public void createIncludePageSegment(String name, int x, int y) {
+    public void createIncludePageSegment(String name, int x, int y, int width, int height)
{
         int xOrigin;
         int yOrigin;
         int orientation = paintingState.getRotation();
         switch (orientation) {
         case 90:
-            xOrigin = currentPage.getWidth() - y;
-            yOrigin = x;
+            xOrigin = x - height;
+            yOrigin = y;
             break;
         case 180:
-            xOrigin = currentPage.getWidth() - x;
-            yOrigin = currentPage.getHeight() - y;
+            xOrigin = x - width;
+            yOrigin = y - height;
             break;
         case 270:
-            xOrigin = y;
-            yOrigin = currentPage.getHeight() - x;
+            xOrigin = x;
+            yOrigin = y - height;
             break;
         default:
             xOrigin = x;

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/AFPPainter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/AFPPainter.java?rev=894350&r1=894349&r2=894350&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/AFPPainter.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/AFPPainter.java Tue Dec 29 11:00:41
2009
@@ -187,7 +187,10 @@
         if (name != null) {
             float[] srcPts = {rect.x, rect.y};
             int[] coords = unitConv.mpts2units(srcPts);
-            getDataStream().createIncludePageSegment(name, coords[X], coords[Y]);
+            int width = Math.round(unitConv.mpt2units(rect.width));
+            int height = Math.round(unitConv.mpt2units(rect.height));
+
+            getDataStream().createIncludePageSegment(name, coords[X], coords[Y], width, height);
         } else {
             drawImageUsingURI(uri, rect);
         }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/AFPRenderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/AFPRenderer.java?rev=894350&r1=894349&r2=894350&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/AFPRenderer.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/AFPRenderer.java Tue Dec 29 11:00:41
2009
@@ -468,9 +468,11 @@
 
         String name = (String)pageSegmentMap.get(uri);
         if (name != null) {
-            float[] srcPts = {x, y};
+            float[] srcPts = {x, y, posInt.width,  posInt.height};
             int[] coords = unitConv.mpts2units(srcPts);
-            dataStream.createIncludePageSegment(name, coords[X], coords[Y]);
+            int width = Math.round(unitConv.mpt2units(posInt.width));
+            int height = Math.round(unitConv.mpt2units(posInt.height));
+            dataStream.createIncludePageSegment(name, coords[X], coords[Y], width, height);
         } else {
             ImageManager manager = userAgent.getFactory().getImageManager();
             ImageInfo info = null;

Modified: xmlgraphics/fop/trunk/status.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/status.xml?rev=894350&r1=894349&r2=894350&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/status.xml (original)
+++ xmlgraphics/fop/trunk/status.xml Tue Dec 29 11:00:41 2009
@@ -58,6 +58,9 @@
       documents. Example: the fix of marks layering will be such a case when it's done.
     -->
     <release version="FOP Trunk" date="TBD">
+      <action context="Renderers" dev="CB" type="fix" fixes-bug="48453">
+        Bugfix: AFP Renderer: Page Segments not positioned correctly when reference-orientation
!= 0
+      </action>
       <action context="Fonts" dev="JM" type="add">
         Added support for TrueType fonts with symbol character maps (like "Wingdings" and
"Symbol").
         Character for these fonts are usually found in the 0xF020 to 0xF0FF range



---------------------------------------------------------------------
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