]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/g2d/G2DSceneGraph.java
Move state changes away from render method to refresh method
[simantics/platform.git] / bundles / org.simantics.scenegraph / src / org / simantics / scenegraph / g2d / G2DSceneGraph.java
index 204181c3786fe01631e4b333cce06a7e681bdfd3..9055a8efeca37c1c4822558b77c6ab1c36d242cb 100644 (file)
@@ -105,9 +105,9 @@ public class G2DSceneGraph extends G2DParentNode implements ILookupService, INod
         return focusNode;
     }
 
-    @Override
+    @Override    
     public void render(Graphics2D g2d) {
-        performCleanup();
+        refresh();
         Component rootPane = getRootPane();
         if (rootPane != null)
             g2d.setRenderingHint(G2DRenderingHints.KEY_COMPONENT, rootPane);
@@ -116,6 +116,12 @@ public class G2DSceneGraph extends G2DParentNode implements ILookupService, INod
         }
     }
 
+    @Override
+    public void refresh() {
+        performCleanup();
+        super.refresh();
+    }
+
     /**
      * Util method for executing updates to scenegraph tree
      * NOTE: You should really consider performance issues when using this