]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/awt/InteractiveVtkPanel.java
DPI scaling for vtkView
[simantics/3d.git] / org.simantics.g3d.vtk / src / org / simantics / g3d / vtk / awt / InteractiveVtkPanel.java
index d697070cfbae165dfb49ff7cf3efe5a3dd28c738..761309e2697b18e0d9cdcbdfd68fada219ba9cc9 100644 (file)
@@ -20,6 +20,7 @@ import org.eclipse.core.runtime.Platform;
 import org.simantics.g3d.scenegraph.RenderListener;
 import org.simantics.g3d.vtk.action.vtkAction;
 import org.simantics.g3d.vtk.common.VtkView;
+import org.simantics.scenegraph.utils.DPIUtil;
 import org.simantics.utils.threads.AWTThread;
 import org.simantics.utils.threads.IThreadWorkQueue;
 
@@ -127,14 +128,29 @@ public class InteractiveVtkPanel extends vtkPanel implements VtkView {
        }
        
        public void setSize(int x, int y) {
+               super.setSize(x, y);
+       }
+       
+       public void _setSize(int x, int y) {
+               System.out.println(this.getClass().getSimpleName() + " " + windowset + " setSize " +x + " " + y);
                if (windowset == 1) {
+                       
                        Lock();
                        rw.SetSize(x, y);
                        iren.SetSize(x, y);
                        iren.ConfigureEvent();
                        UnLock();
+               } else {
+                       if (x > 1000)
+                               System.out.println();
                }
        }
+       
+       @Override
+       public void setBounds(int x, int y, int width, int height) {
+               super.setBounds(x, y, width, height);
+               _setSize(width, height);
+       }
 
        private vtkScenePicker scenePicker;
        
@@ -440,6 +456,16 @@ public class InteractiveVtkPanel extends vtkPanel implements VtkView {
                repaint();
        }
        
+       @Override
+       public double upscale(double d) {
+               return DPIUtil.upscale(d);
+       }
+       
+       @Override
+       public int upscale(int i) {
+               return DPIUtil.upscale(i);
+       }
+       
        
        
 }