On Thu, 20 Oct 2022 16:06:36 GMT, Andy Goryachev <ango...@openjdk.org> wrote:

>> Johan Vos has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   address reviewer comments
>>   Fix detection on screen, based on awtScale factors
>
> modules/javafx.swing/src/main/java/javafx/embed/swing/JFXPanel.java line 451:
> 
>> 449:         Dimension2D onScreen = 
>> getSwingToFxPixel(getGraphicsConfiguration(), e.getXOnScreen(), 
>> e.getYOnScreen());
>> 450:         int fxXOnScreen = (int) onScreen.getWidth();
>> 451:         int fxYOnScreen = (int) onScreen.getHeight();
> 
> question: should it be (int) or Math.round()?
> also, coordinates can be negative - will it work then?

I believe these values should be int in the first place. Otherwise, we have 
issues in JavaFX where we process them as ints.
About negative coordinates: yes, that works. Is the question about using 
Dimension2D (width/height) for something that is actually a Point2D? We can use 
a Point2D here as well, but that class seems to have a bit more overhead than 
Dimension2D for this goal -- but I'm open to change it to Point2D.

-------------

PR: https://git.openjdk.org/jfx/pull/924

Reply via email to