]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - vtk.rendering/src/vtk/rendering/vtkAbstractComponent.java
Focus action
[simantics/3d.git] / vtk.rendering / src / vtk / rendering / vtkAbstractComponent.java
index e68bd467d8d5ac91dc4f2791fb3ef82455a4cd24..c905a72f3020a614d6fdce63f13ca87af3376478 100644 (file)
@@ -2,6 +2,8 @@ package vtk.rendering;
 
 import java.util.concurrent.locks.ReentrantLock;
 
+import org.eclipse.swt.internal.DPIUtil;
+
 import vtk.vtkAxesActor;
 import vtk.vtkCamera;
 import vtk.vtkGenericRenderWindowInteractor;
@@ -130,7 +132,8 @@ public abstract class vtkAbstractComponent<T> implements vtkComponent<T> {
     if (renderWindow == null || windowInteractor == null) {
       return; // Nothing to do we are deleted...
     }
-
+    w = DPIUtil.autoScaleUp(w);
+    h = DPIUtil.autoScaleUp(h);
     try {
       lock.lockInterruptibly();
       renderWindow.SetSize(w, h);
@@ -144,8 +147,12 @@ public abstract class vtkAbstractComponent<T> implements vtkComponent<T> {
 
   public void Delete() {
     this.lock.lock();
+    this.renderer.DrawOff();
+    this.renderer.Delete();
     this.renderer = null;
+    this.camera.Delete();
     this.camera = null;
+    this.windowInteractor.Delete();
     this.windowInteractor = null;
     // removing the renderWindow is let to the superclass
     // because in the very special case of an AWT component