RFR: 8222210: JFXPanel popups open at wrong coordinates when using multiple hidpi monitors [v2]
Andy Goryachev
angorya at openjdk.org
Wed Nov 2 19:14:34 UTC 2022
On Wed, 2 Nov 2022 18:51:56 GMT, Johan Vos <jvos at openjdk.org> wrote:
>> We need the int values, as they are used to invoke `mouseEvent`, `scrollEvent` and `menuEvent` on `com.sun.javafx.embed.EmbeddedSceneInterface` .
>> For some reason, `scrollEvent` takes doubles, but `mouseEvent` and `menuEvent` take ints.
>> I'll use `Math.floor()` instead of the `int` cast. The key thing here is that the strategy for the mouse/scroll/menu events should be the same as the strategy for the window location changes.
>
>> And yes, I did not see Dimension2D - we probably should remove confusion and use Point2D (why does it have more overhead?)
>
> Point2D provides much more functionality -- but has 2 fields only. So it should not be an overhead at all, hence I'll switch to Point2D. Thanks for Pointing that out :)
I suspect Math.floor() would be incorrect - we should use Math.round() for coordinates and Math.floor() for sizes (sizes will always be positive, I hope, and the rounded size will be slightly smaller than the original value).
But for coordinates we should use (int)Math.round()
-------------
PR: https://git.openjdk.org/jfx/pull/924
More information about the openjfx-dev
mailing list