Export: avoid black rectangle with title.xml image 32/14332/1
Calixte DENIZET [Fri, 4 Apr 2014 07:37:05 +0000 (09:37 +0200)]
Change-Id: Ib9ee777c16b717eeaa3bbc2610771041320ea53c

scilab/modules/renderer/src/java/org/scilab/modules/renderer/JoGLView/axes/AxesDrawer.java

index 78d02b4..8756d75 100644 (file)
@@ -183,7 +183,14 @@ public class AxesDrawer {
 
     public void computeMargins(Axes axes) {
         if (axes.getAutoMargins() && axes.getViewAsEnum() == ViewType.VIEW_2D) {
-            ColorMap colorMap = visitor.getColorMap();
+            Figure figure = (Figure) GraphicController.getController().getObjectFromId(axes.getParentFigure());
+            ColorMap colorMap = null;
+            if (figure != null) {
+                colorMap = figure.getColorMap();
+            } else {
+                return;
+            }
+
             Dimension[] marginLabels = labelManager.getLabelsSize(colorMap, axes, this);
             Integer[] size = {visitor.getCanvas().getWidth(), visitor.getCanvas().getHeight()};
             // [x_left, y_up, w, h]