Author: clopes
Date: 2011-07-05 10:01:13 -0700 (Tue, 05 Jul 2011)
New Revision: 26020

Modified:
   
cytoscapeweb/branches/compound/src/org/cytoscapeweb/view/render/NodeRenderer.as
Log:
Fixed rendering issues when drawing large bitmaps on small nodes.

Modified: 
cytoscapeweb/branches/compound/src/org/cytoscapeweb/view/render/NodeRenderer.as
===================================================================
--- 
cytoscapeweb/branches/compound/src/org/cytoscapeweb/view/render/NodeRenderer.as 
    2011-07-05 16:23:31 UTC (rev 26019)
+++ 
cytoscapeweb/branches/compound/src/org/cytoscapeweb/view/render/NodeRenderer.as 
    2011-07-05 17:01:13 UTC (rev 26020)
@@ -30,6 +30,8 @@
 package org.cytoscapeweb.view.render {
        import flare.util.Shapes;
        import flare.vis.data.DataSprite;
+       import flare.vis.data.EdgeSprite;
+       import flare.vis.data.NodeSprite;
        import flare.vis.data.render.ShapeRenderer;
        
        import flash.display.BitmapData;
@@ -87,6 +89,9 @@
             var g:Graphics = d.graphics;
             g.clear();
             
+            // Just to prevent rendering issues when drawing large bitmaps on 
small nodes:
+            d.cacheAsBitmap = d.props.imageUrl != null;
+            
             if (lineAlpha > 0 && d.lineWidth > 0) {
                 var pixelHinting:Boolean = d.shape === 
NodeShapes.ROUND_RECTANGLE;
                 g.lineStyle(d.lineWidth, d.lineColor, lineAlpha, pixelHinting);
@@ -103,6 +108,13 @@
                 // 2. Draw an image on top:
                 drawImage(d, size);
             }
+            
+            // To prevent gaps between the node and its edges when the node 
has the
+            // border width changed on mouseover or selection
+            NodeSprite(d).visitEdges(function(e:EdgeSprite):Boolean {
+               e.dirty();
+               return false; 
+            }, NodeSprite.GRAPH_LINKS);
         }
         
         // ========[ PRIVATE METHODS 
]==============================================================

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