Help: fix bad xcos image export with Command_bode.xcos 55/11155/3
Calixte DENIZET [Thu, 28 Mar 2013 17:33:05 +0000 (18:33 +0100)]
Change-Id: I1e4553c78847ea8a43ad1158ba58dbe9d7db1be4

scilab/modules/graph/src/java/org/scilab/modules/graph/shape/LatexTextShape.java

index c69745c..972c732 100644 (file)
@@ -15,6 +15,7 @@ package org.scilab.modules.graph.shape;
 import java.awt.Color;
 import java.awt.Graphics2D;
 import java.awt.Rectangle;
+import java.awt.Shape;
 import java.awt.geom.AffineTransform;
 import java.util.Map;
 
@@ -114,12 +115,14 @@ public class LatexTextShape implements mxITextShape {
                 final double dx = (sw - iw) / 2;
                 final double dy = (sh - ih) / 2;
 
+                Shape oldClip = g.getClip();
+                g.setClip(rect);
                 icon.paintIcon(rendererPane, g, (int) (sx + dx), (int) (sy + dy));
+                g.setClip(oldClip);
 
                 // Restores the previous transformation
                 g.setTransform(at);
             }
         }
     }
-
 }