You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-commits@xmlgraphics.apache.org by lb...@apache.org on 2014/12/08 13:51:25 UTC

svn commit: r1643798 - in /xmlgraphics/batik/trunk: samples/tests/resources/wmf/batik-rendering-nothing2.wmf sources/org/apache/batik/transcoder/wmf/tosvg/WMFRecordStore.java

Author: lbernardo
Date: Mon Dec  8 12:51:24 2014
New Revision: 1643798

URL: http://svn.apache.org/r1643798
Log:
BATIK-1096: Wrong WMF to SVG conversion due to anisotropic scaling

Added:
    xmlgraphics/batik/trunk/samples/tests/resources/wmf/batik-rendering-nothing2.wmf   (with props)
Modified:
    xmlgraphics/batik/trunk/sources/org/apache/batik/transcoder/wmf/tosvg/WMFRecordStore.java

Added: xmlgraphics/batik/trunk/samples/tests/resources/wmf/batik-rendering-nothing2.wmf
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/samples/tests/resources/wmf/batik-rendering-nothing2.wmf?rev=1643798&view=auto
==============================================================================
Binary file - no diff available.

Propchange: xmlgraphics/batik/trunk/samples/tests/resources/wmf/batik-rendering-nothing2.wmf
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/transcoder/wmf/tosvg/WMFRecordStore.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/transcoder/wmf/tosvg/WMFRecordStore.java?rev=1643798&r1=1643797&r2=1643798&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/transcoder/wmf/tosvg/WMFRecordStore.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/transcoder/wmf/tosvg/WMFRecordStore.java Mon Dec  8 12:51:24 2014
@@ -252,15 +252,12 @@ public class WMFRecordStore extends Abst
                         ySign = -1;
                     }
 
-                    mr.addElement((int)(width  * scaleXY));
-                    mr.addElement( height );
-                    records.add( mr );
-
                     if (_bext && functionId == WMFConstants.META_SETWINDOWEXT) {
                       vpW = width;
                       vpH = height;
-                      if (! isotropic) scaleXY = (float)vpW / (float)vpH;
-                      vpW = (int)(vpW * scaleXY);                      
+                      // two lines below commented out due to bug BATIK-1096
+                      // if (! isotropic) scaleXY = (float)vpW / (float)vpH;
+                      // vpW = (int)(vpW * scaleXY);
                       _bext = false;
                     }
                     // sets the width, height of the image if the file does not have an APM (in this case it is retrieved
@@ -269,6 +266,10 @@ public class WMFRecordStore extends Abst
                         this.width = vpW;
                         this.height = vpH;
                     }                            
+
+                    mr.addElement((int)(width  * scaleXY));
+                    mr.addElement( height );
+                    records.add( mr );
                 }
                 break;