]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/g2d/nodes/BackgroundNode.java
Fix SCL SceneGraph is omitting graphical elements
[simantics/platform.git] / bundles / org.simantics.scenegraph / src / org / simantics / scenegraph / g2d / nodes / BackgroundNode.java
index 46804e6569a3b7fa2512f90a4fba4a9e83844528..00c18879bf526a777467b669c588bdba920d2b84 100644 (file)
@@ -47,7 +47,10 @@ public class BackgroundNode extends G2DNode {
     public void render(Graphics2D g) {
        Rectangle2D drawBounds = bounds;
         if(drawBounds == null) {
-               drawBounds = (Rectangle2D)g.getClipBounds().clone(); // Fill whole clip area if bounds is not defined
+               if (g.getClipBounds() != null)
+                       drawBounds = (Rectangle2D)g.getClipBounds().clone(); // Fill whole clip area if bounds is not defined
+               else
+                       return;
         }
         
         if (color!=null) {