-
Bug
-
Resolution: Fixed
-
P3
-
fx1.0
-
Emulator running on Windows XP, 6u10
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;
}
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;
}