JDK-8124737 : Incorrect coordinates determination: need to add minX and minY.
  • Type: Bug
  • Component: javafx
  • Sub-Component: scenegraph
  • Affected Version: 8
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2013-05-10
  • Updated: 2015-06-17
  • Resolved: 2013-05-16
Related Reports
Relates :  
Description
See https://javafx-jira.kenai.com/browse/RT-29551

"1. In that case you'll also need to add the minX, minY of the layout bounds of the Popup's root group to the calculated x, y. There is localToScreen method on a Node which was supposed to do this, but I forgot about its existence and didn't update it when fixing RT-28775. Could you file that as a separate issue?"

My comment : 

I tried on build, which shows sequential menus in correct order, and localToScreen works correctly, but manual coordinates evaluation - StageXY + SceneXY + LocalToScene don't show correct result - I need to add minXY. This is question of API incorrectness - after localToScene I don't need to think about any content allocation on scene.

minX - the X coordinate of the upper-left corner
minY - the Y coordinate of the upper-left corner

public Bounds localToScene(Bounds localBounds)
Transforms a bounds from the local coordinate space of this Node into the coordinate space of its Scene.
Parameters:
localBounds - bounds in Node's space
Comments
Unit tests: javafx.stage.PopupTest.testLocalToScreenWithContentAlignment javafx.stage.PopupTest.testScreenToLocalWithContentAlignment
16-05-2013

Added Popup window translate compensation to SceneXY values. So now the final translate of the Popup window is more transparent to user code.
16-05-2013

Changeset: cbf2c1a0499e Author: Lubomir Nerad <lubomir.nerad@oracle.com> Date: 2013-05-15 10:48 +0200 URL: http://hg.openjdk.java.net/openjfx/8/graphics/rt/rev/cbf2c1a0499e Fix for RT-30319: Incorrect coordinates determination: need to add minX and minY.
16-05-2013

There were development unit tests, but they didn't test translated Windows (the Popup case), which didn't exist at the time when the tests were written. I added the tests with RT-29728.
13-05-2013

Lubomir, in previous bug you've said, that you've forgot about fix in local to screen method. Am I correct, when think, that there are no tests on this area? Because movements of functionality are significant, but code was pushed. So I need to file an issue on tests writing?
13-05-2013

The SceneXY + LocalToScene will transform the coordinates to the window coordinate space, where the 0, 0 point corresponds to the upper left corner of the Popup. But the StageXY no longer correspond to the upper left corner of the Popup as requested by RT-28775, so simply adding StageXY won't work. We can try to compensate the additional window transformation in SceneXY. The problem is that currently the SceneXY is defined by system depending on the window type. Changing it will make the FX scene coordinates incompatible with scene coordinates reported by system. So all places where we use system reported scene coordinates or we report some scene coordinates to system will need to be changed. Also we need to check whether the specification of SceneXY allows such change. In any case the tests should use the more appropriate localToScreen conversion method. This method does the conversion correctly, so there should be no obstacle for Popup testing and no reason for such a high priority of this issue.
13-05-2013

Critical : prevents testing of popups ..
10-05-2013