Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8088275

SubScene mouse events not affected by camera transform

    Details

      Description

      Prerequisites: Seperate Camera on a SubScene:

      The MouseEvents report always the same values even if the camera translates and shows a different part of the scene. Minimal Code:

          @Override
          public void start(Stage primaryStage) throws Exception{
              Pane rootOne = new Pane();
              rootOne.getChildren().add(new Circle(30, Color.RED));
              SubScene subScene = new SubScene(rootOne, 300, 270);
              Group root = new Group(subScene);
              Scene scene = new Scene(root, 300, 275);
              final Camera camera = new ParallelCamera();
              subScene.setCamera(camera);

              scene.setOnMousePressed(event -> {
                  System.out.println(event.getX() + " " + event.getSceneX() + " " + event.getScreenX());
                  camera.setTranslateX(camera.getTranslateX() - 30);
              });
              primaryStage.setScene(scene);
              primaryStage.show();
          }

      Stay with the mouse on the same spot and click. The Camera translates, and with it the objects but the MouseEvent reports the same coordinates on every field.

        Attachments

          Activity

            People

            • Assignee:
              ckyang Chien Yang (Inactive)
              Reporter:
              duke J. Duke (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: