Author: Christian Lopes
Date: 2010-07-08 15:07:42 -0700 (Thu, 08 Jul 2010)
New Revision: 20861

Modified:
   
cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/view/ApplicationMediator.as
Log:
Fixed bug that caused wrong labels alignment or incorrect shapes on PDF or PNG 
images, when exporting the network with low zoom value (Mantis #2292).

Modified: 
cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/view/ApplicationMediator.as
===================================================================
--- 
cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/view/ApplicationMediator.as
    2010-07-08 22:06:32 UTC (rev 20860)
+++ 
cytoscapeweb/trunk/cytoscapeweb/src/org/cytoscapeweb/view/ApplicationMediator.as
    2010-07-08 22:07:42 UTC (rev 20861)
@@ -203,6 +203,9 @@
             var bytes:ByteArray;
             var scale:Number = graphProxy.zoom;
 
+            // Otherwise, it may draw the shapes incorrectly, or labels might 
have wrong alignment:
+            if (scale !== 1) graphView.zoomTo(1);
+
             if (type === "png") {
                 var bounds:Rectangle = graphView.vis.getRealBounds();
                 // At least 1 pixel:
@@ -221,13 +224,16 @@
                 // PDF:
                 var pdfConv:PDFExporter = new PDFExporter(graphView);
                 bytes = pdfConv.export(graphProxy.graphData,
-                                             configProxy.visualStyle,
-                                             configProxy.config,
-                                             scale,
-                                             width,
-                                             height);
+                                       configProxy.visualStyle,
+                                       configProxy.config,
+                                       graphProxy.zoom,
+                                       width,
+                                       height);
             }
             
+            // Set previous scale:
+            if (scale != graphProxy.zoom) graphView.zoomTo(scale);
+            
             return bytes;
         }
         

-- 
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en.

Reply via email to