Coordinate translation methods such as Node's parentToLocal, sceneToLocal, localToParent, localToScene need to take geometry altering effects into account. Right now they use only translations and ignore effects completely. Some of the effects alter node's geometry and have to be used for coordinate translation otherwise coordinate translation and all the things which depend on it such as mouse event delivery are broken. For example if a node has PerspectiveTransform applied to it then translation methods of such a node do not work correctly.
Try the following for example:
=====
import javafx.scene.*;
import javafx.scene.effect.*;
import javafx.scene.shape.*;
import javafx.scene.input.*;
import java.lang.Math;
var width = 200;
var height = 200;
var radius = width/2;
var back = height/10;
var t = 3.14 / 8;;
Rectangle {
x:10 y:10 width:100 height:100
effect: PerspectiveTransform {
ulx: radius - Math.sin(t)*radius uly: 0 - Math.cos(t)*back
urx: radius + Math.sin(t)*radius ury: 0 + Math.cos(t)*back
lrx: radius + Math.sin(t)*radius lry: height - Math.cos(t)*back
llx: radius - Math.sin(t)*radius lly: height + Math.cos(t)*back
}
onMouseMoved:function(e:MouseEvent):Void {
println(e);
}
}
=====
The right side of the transformed rectangle does not react on mouse at all.
- is blocked by
-
JDK-8105112 The bounding box of the text whose effect is a perspective transform returns a rect( x/y=0.0/0.0, w/h=0.0/0.0) during the animation
-
- Closed
-
- relates to
-
JDK-8107616 Picking needs to take geometry-altering effects into account
-
- Closed
-