X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.g3d.vtk%2Fsrc%2Forg%2Fsimantics%2Fg3d%2Fvtk%2Fswt%2FInteractiveVtkComposite.java;h=b8f9ff0c459ded51c4e38679d8c5d595cd1e0b21;hb=refs%2Fchanges%2F28%2F3328%2F1;hp=b20bcac731dc609d7d4943274a0db59e19a07947;hpb=f36217aeeb09c0c46f99886ee99772156ce9cfe6;p=simantics%2F3d.git diff --git a/org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/swt/InteractiveVtkComposite.java b/org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/swt/InteractiveVtkComposite.java index b20bcac7..b8f9ff0c 100644 --- a/org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/swt/InteractiveVtkComposite.java +++ b/org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/swt/InteractiveVtkComposite.java @@ -280,26 +280,26 @@ public class InteractiveVtkComposite extends vtkSwtComponent implements VtkView{ return processPick(picker, apath); } else if (pickType == 5) { vtkActor2DCollection coll = ren.GetActors2D(); - coll.InitTraversal(); - vtkActor2D a; - - List picked = new ArrayList(); - while ((a = coll.GetNextItem()) != null) { - double pos[] = a.GetPosition(); - // TODO : width and height do not seem to affect the perceived size of Actor2D. - // actual size should be fetched from mapper. - double w = a.GetWidth(); - double h = a.GetHeight(); - int minx = (int)(pos[0]-w*0.5); - int miny = (int)(pos[1]-h*0.5); - int maxx = (int)(pos[0]+w*0.5); - int maxy = (int)(pos[1]+h*0.5); - if (minx <= ax && maxx >= ax && - miny <= ay && maxy >= ay) { - picked.add(a); - } - } - return picked.toArray(new vtkProp[picked.size()]); + coll.InitTraversal(); + vtkActor2D a; + + List picked = new ArrayList(); + while ((a = coll.GetNextItem()) != null) { + double pos[] = a.GetPosition(); + // TODO : width and height do not seem to affect the perceived size of Actor2D. + // actual size should be fetched from mapper. + double w = a.GetWidth(); + double h = a.GetHeight(); + int minx = (int)(pos[0]-w*0.5); + int miny = (int)(pos[1]-h*0.5); + int maxx = (int)(pos[0]+w*0.5); + int maxy = (int)(pos[1]+h*0.5); + if (minx <= ax && maxx >= ax && + miny <= ay && maxy >= ay) { + picked.add(a); + } + } + return picked.toArray(new vtkProp[picked.size()]); } return null;