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

Mobile: blocksMouse do not work correctly when the node is within a group

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: fx1.0
    • Fix Version/s: fx1.1
    • Component/s: javafx
    • Environment:

      Emulator running on Windows XP, 6u10

      Description

      Run the attached program. It shows a Group containing a Rectangle. Rectangle has blocksMouse set to true. When mouse is clicked on Rectangle, a Node below the Rectangle also receives the event.
      This is reproducible only on emulator. On desktop, event will not reach the node below.
      To reproduce, run the following code on emulator. Click on the area of the red rectangle overlapping with the blue rectangle underneath. It could be seen that blue rectangle comes on top.

      import javafx.scene.paint.*;
      import javafx.scene.shape.*;
      import javafx.scene.input.*;
      import javafx.stage.*;
      import javafx.scene.*;

      public class BlocksMouseTest {
          var redRect: Rectangle = Rectangle {
              x: 70
              y: 70
              width: 60
              height: 80
              blocksMouse: true
              fill: Color.RED
              opacity: 0.8
              onMouseClicked: function(e: MouseEvent) {
                  redRect.toFront();
              }
          };
          var blueRect: Rectangle = Rectangle {
              x: 80
              y: 100
              blocksMouse: true
              width: 80
              height: 80
              fill: Color.BLUE
              onMouseClicked: function(e: MouseEvent) {
                  blueRect.toFront();
              }
          };
          var group: Group = Group {
              content: [redRect]
          };
          var topGroup: Group = Group {
              content: [blueRect, group]
          };
          init {
              var s = Stage {
                  width: 300
                  height: 300
                  scene: Scene {
                      content: topGroup
                  }
              };
          }
      }
      function run() {
          new BlocksMouseTest;
      }

        Attachments

          Activity

            People

            • Assignee:
              ailjin Artem Iljin (Inactive)
              Reporter:
              gramachasunw Girish Ramachandran (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: